✓ Accepted answer
Hey buddy!
I've always hated these types of issues and they're very annoying to fix, but let me help ya!
First, I need to teach you about RemoteEvents.
RemoteEvents are the bypasser of this type of issue, as they're able to pass information from the entire server to only one player.
In this case, it would help you!
Secondly, insert a RemoteEvent into the ReplicatedStorage and name it however you like.
Put a regular script inside and type in:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:WaitForChild("Humanoid",10) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.ReplicatedStorage.RemoteEventNameHere:FireClient(player)
end
end)
Lastly, insert a LocalScript into the StarterGui and then type in:
game.ReplicatedStorage.RemoteEventNameHere.OnClientEvent:Connect(function()
end)
To learn more about RemoteEvents, go to here
3 comments
Thanks, it's working now :)
But the scripts don't work in the map when I clone it, is there a way to fix this?
I don't know, though. Try researching more, That I can't help with.