Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Touched Event Help? (Unsolved)

Asked by
Bman8765 270 Moderation Voter
9 years ago

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)

0
Simply parent the message to the players Backpack or PlayerGui TopDev 0 — 9y
0
I'm sorry but I don't understand that Bman8765 270 — 9y

2 answers

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
9 years ago

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)
Ad
Log in to vote
-1
Answered by 9 years ago

one problem i see is you said

message.Visible = true
--It should be
game.Workspace.message.Visible=true
0
MEssage is a variable defined above so no. Bman8765 270 — 9y
0
sorry i derped bubbaman73 143 — 9y

Answer this question