of     1   

Cheeso135
#144433622Sunday, August 24, 2014 9:43 PM GMT

Basically, I want to make it so that when a part is touched by the player, a tool called Book is given to the player and their starter pack until the book touches a part that destroys it. Then, they cannot get it again. Would it be something like this?: function onTouched(part) local player = game.workspace.Players.LocalPLayer local book = game.ReplicatedStorage.Book if player then book:Clone().Parent = player.Backpack book:Clone().Parent = player.StarterGear until……? I don't know how to make it so that the book will not clone after it touches the other part. (The other part's name is taker)
Kannivalismos
#144434048Sunday, August 24, 2014 9:48 PM GMT

Uh. You're calling a touched event via localscript? Players is not a part of workspace, it's a part of game. In a script, inside the part you want them to touch, put something like this: function onTouched(part) if game.Players:GetPlayerFromCharacter(part.Parent) then plr = game.Players:GetPlayerFromCharacter(part.Parent) book = game.ReplicatedStorage.Book if not plr.StarterGear:FindFirstChild("Book") then book:Clone().Parent = plr.Backpack book:Clone().Parent = plr.StarterGear end end end script.Parent.Touched:connect(onTouched)
Cheeso135
#144434198Sunday, August 24, 2014 9:50 PM GMT

Ok that looks a lot better than mine lol but…how would I do the thing where it is cloned in starter pack until it is removed when it touches the other part?
NotedDown
#144434437Sunday, August 24, 2014 9:53 PM GMT

i think its for iv in pair then return false if 1 ~= z + 2 and not if connect:function(roblox) is not equal to what true is then print "activates no problem" but if 1.game.workspace ~= 3 then print "wow./
Kannivalismos
#144434514Sunday, August 24, 2014 9:53 PM GMT

In brick to give book: function onTouched(part) if game.Players:GetPlayerFromCharacter(part.Parent) then plr = game.Players:GetPlayerFromCharacter(part.Parent) book = game.ReplicatedStorage.Book if not plr.StarterGear:FindFirstChild("Book") then book:Clone().Parent = plr.Backpack book:Clone().Parent = plr.StarterGear end end end script.Parent.Touched:connect(onTouched) In brick to remove book: function onTouched(part) if game.Players:GetPlayerFromCharacter(part.Parent) then plr = game.Players:GetPlayerFromCharacter(part.Parent) if plr.StarterGear:FindFirstChild("Book") then plr.StarterGear.Book:destroy() if plr.Backpack:FindFirstChild("Book") then plr.Backpack.Book:destroy() end if plr.Character:FindFirstChild("Book") then plr.Character.Book:destroy() end end end end script.Parent.Touched:connect(onTouched)
Cheeso135
#144434770Sunday, August 24, 2014 9:57 PM GMT

I am using this to remove the book: function onTouched(hit) local characterModel = hit.Parent local player = game.Players:GetPlayerFromCharacter(characterModel) if player then local leaderstats = player:FindFirstChild("leaderstats") if not leaderstats then return end local honor = leaderstats:FindFirstChild("Honor") if not honor then return end local book = characterModel:FindFirstChild("Book") if book then book:Destroy() honor.Value = honor.Value + 2 end end end script.Parent.Touched:connect(onTouched) But how do I make it so that once this part is touched, it stops the book from being cloned to starter pack?

    of     1