Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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,

4 comments

0

What's the error?

0

The erorr says the part is not there even though when i manually look in the explorer tab it is there

0

Make sure the path is correct, and I can't really help since you didn't provide the code.

0

Alright

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.