Hi all, I am trying to make a tutorial GUI that runs on local scripts to bring up a part in the workspace and when touched, changes a value in the gui.
I haven’t experimented with onTouch events through GUI before so I am lost to what the problem could be, if I am even doing it right to begin with. In the ouput i get “WayPoint1 is not a valid member of Workspace “Workspace” - Client - LocalScript:2”
The script is inside a ScreenGUI along with a bool variable. The Main script that runs the GUI goes into a wait loop until said variable becomes true when a part is touched then it continues to the rest of the tutorial. This script below is to change that variable’s value.
What am I missing?
local Point1 = workspace.WayPoint1
local Point2 = workspace.WayPoint2
local Point3 = workspace.WayPoint3
local Player = game.Players.LocalPlayer
Point1.Touched:Connect(function(PartTouched)
if PartTouched.Parent.Name == Player.Name then -- If the players name = the player then it destorys the part on his client and not others
script.Parent.waitval.Value = true
end
end)
Point2.Touched:Connect(function(PartTouched)
if PartTouched.Parent.Name == Player.Name then -- If the players name = the player then it destorys the part on his client and not others
script.Parent.waitval.Value = true
end
end)
Point3.Touched:Connect(function(PartTouched)
if PartTouched.Parent.Name == Player.Name then -- If the players name = the player then it destorys the part on his client and not others
script.Parent.waitval.Value = true
end
end)