Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Touched Event Help? (Unsolved)

So I have this function

Workspace.Quest1.Touched:connect(touchedquest1)

(Quest1 is a part)

and here is what the function does

function touchedquest1()
if theytouchedquest1 == 0 then	
theytouchedquest1 = 1	
message.Visible = true
for key = 1, #text1 do
message.Text = (text1:sub(1, key))
wait()
end
elseif theytouchedquest1 == 1 then
end
end

theytouchedquest1 is a variable.

My problem is whenever a user touches the part everyone has that function show up, is there anyway to make it so only the person that touched it will have it show up on there screen? (this is in a localscript)

2 comments

0

Simply parent the message to the players Backpack or PlayerGui

0

I'm sorry but I don't understand that

2 answers

Well if your problem is that it comes up for everyone.. You will want to make it say what player then... It's a simple way to do it..

function bleh(player) -- this will resort in the part that touched the brick
plr = game.Players:FindFirstChild(player.Parent.Name) -- You need parent or else it's just going to be "LeftLeg" or "RightLeg"
if theytouchedquest1 == 0 then
theytouchedquest = 1
plr.PlayerGUI.Visible = true -- You will have to route it to what needs to be visible..
-- put the rest of the code..
end

game.Workspace:FindFirstChild("Quest1"):connect(bleh)

one problem i see is you said

message.Visible = true
--It should be
game.Workspace.message.Visible=true

2 comments

0

MEssage is a variable defined above so no.

0

sorry i derped

This discussion is preserved as it was. New answers, comments, and votes are closed.