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

I have an on client event that is not working with one of the things im trying to do?

Asked by 3 years ago

I have a on client event from a regular script to a local script for whenever a player or character is added which works, but when i reset and it fires it again it gives me an error even though it worked the first time. Along with this i have a script that inserts a part with a proximity prompt inside of it and thats what i want to be effected,

0
What's the error? Xx_XSanderPlayXx 160 — 3y
0
The erorr says the part is not there even though when i manually look in the explorer tab it is there TeaWithMee 76 — 3y
0
Make sure the path is correct, and I can't really help since you didn't provide the code. Xx_XSanderPlayXx 160 — 3y
0
Alright TeaWithMee 76 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Just Adding the code :)

server client trigger

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        game.ReplicatedStorage.Event1:FireClient(player)
    end)
end)

Local script function

wait(2)
local player = game.Players.LocalPlayer.Name 
local char = game.Workspace:FindFirstChild(player)
game.ReplicatedStorage.Event1.OnClientEvent:Connect(function(plr)
    wait(2)
    print("Worked")
    wait(5)
    char.TorsoPart.ProximityPrompt.Enabled = false
    end)
Ad

Answer this question