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

Umm now next problem local script not working?

this is script

local Goo = script.Parent
local team = BrickColor.new("Dark stone grey")
local infect = game.ReplicatedStorage.GetInfect
local waitd = false

Goo.Touched:Connect(function(hit)
	if not waitd then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent);
		if plr then
			plr.TeamColor = team
		end
		infect:FireClient(plr)
		waitd = true
	end
end)

this is a local script

local infect = game.ReplicatedStorage.GetInfect
local sound = script.Sound

infect.OnClientEvent:Connect(function()
	sound.Playing = true
end)

1 comment

0

on which script and line was the error on?

1 answer

✓ Accepted answer

In server script line 12, the FireClient() event need a necessary argument, player, so that the event knows which player it should fire the replicated event to.

If you are trying to fire the event to the player who hit the 'goo', I suggest you putting game.Players:GetPlayerFromCharacter(hit.Parent) inside the FireClient() bracket. Or simply make a variable.

If you are trying to fire the event to ALL clients, use FireAllClients() instead.

4 comments

0

thank!!!

0

you can pick my answer as solution if it helps :D by doing this, others can easily find the solution they want and my reputation will goes up also :D

0

but next problem is local script not working

0

what is the error?

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