So I wanted to make a script which, when you touch a certain part it will Give you a message,
and since I wanted to make multiple of them, I decided to make it easier to do that,
but the function only works once and never again, I wanna know why does that happen,
and how to fix it.
You can define a function and bind it to multiple events:
local function touch(Humanoid)
print(Humanoid)
if Humanoid.Name == "HumanoidRootPart" then
Humanoid.Anchored = true
Humanoid.Velocity = Vector3.new(0,0,0)
local player = game.Players:FindFirstChild(Humanoid.Parent.Name)
game.ReplicatedStorage.Event:FireClient(player, "Text")
end
end
script.Parent.Tutorial1.Part.Touched:Connect(touch)
script.Parent.Tutorial2.Part.Touched:Connect(touch)
Its needed because where your script is, what kind it is, and making sure your accessing the right part is all potential problems. Let alone faulty gui code.