Hello, I'm trying to get this remote event working for a few days now and i cant get it to work. I hope someone can help me. tell me if i need to post the full script, now i only posted the remote event parts.
--server local RemoteEvent = Instance.new("RemoteEvent") local click = script.Parent:WaitForChild("ClickDetector") click.MouseClick:Connect (function(player) RemoteEvent:FireClient(player) wait(5) for _,v in pairs (script.Parent.Parent.Leaves:GetChildren()) do if v:IsA("Part") then--Checks if the Child that is inside the Model is ClassName Part. v.Anchored = false end end for _,v in pairs (script.Parent.Parent.Logs:GetChildren()) do if v:IsA("Part") then--Checks if the Child that is inside the Model is ClassName Part. v.Anchored = false end end script.Parent.Parent.Wood:Destroy() end) --client local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent") local function RemoteSmall() GetWood = false WC = plr.PlayerGui.WoodChopper WC.BG.Visible = true char.Humanoid.WalkSpeed = 0 char.Humanoid.JumpPower = 0 animation:Play() ShowProgress('SmallTree1') animation:Stop() char.Humanoid.WalkSpeed = 16 char.Humanoid.JumpPower = 50 end RemoteEvent.OnClientEvent:Connect(RemoteSmall)
The reason why your system does not work is because you create a RemoteEvent without parenting it to ReplicatedStorage. This simply causes the client to yield until the RemoteEvent to exist or just indefinitely.
local RemoteEvent = Instance.new("RemoteEvent"); RemoteEvent.Parent = game:GetService("ReplicatedStorage");