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

Umm now next problem local script not working?

Asked by 3 years ago
Edited 3 years ago

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)
0
on which script and line was the error on? fullguyblox3 69 — 3y

1 answer

Log in to vote
0
Answered by
7777ert 49
3 years ago

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.

0
thank!!! Trorapantest1 13 — 3y
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 7777ert 49 — 3y
0
but next problem is local script not working Trorapantest1 13 — 3y
0
what is the error? 7777ert 49 — 3y
Ad

Answer this question