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

FE Handcuffs line 11 is breaking it don't know why?

Asked by 5 years ago

--NOT MINE local Player = game.Players.LocalPlayer local Chr = Player.Character or Player.CharacterAdded:Wait() local Mouse = Player:GetMouse() local Tool = script.Parent local Mode local Torso local Using = false local PTorso local RemoteEvent = script.Parent.RemoteEvent --- Problem here Any Idea if Chr:FindFirstChild'UpperTorso' then PTorso = Chr.UpperTorso else PTorso = Chr.Torso end Tool.Activated:Connect(function() if not Using then if Mouse.Target then RemoteEvent:FireServer('Cuff', Mouse.Target) end else Using = false RemoteEvent:FireServer('UnCuff') end end) RemoteEvent.OnClientEvent:Connect(function( one ) if one == 'Use' then Using = true end end)
0
what's the error thebayou 441 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Try to make it wait for child, such as this

local RemoteEvent = script.Parent:WaitForChild("RemoteEvent")
Ad
Log in to vote
0
Answered by
PolyyDev 214 Moderation Voter
5 years ago

It seems you have a RemoteEvent inside the client where the server can not access. The best place to put RemoteEvents is in ReplicatedStorage as it is shared between the server and the client. I'm assuming that code is in a LocalScript somewhere on the client where it will actually run, i.e not ReplicatedStorage or Workspace. So you need to put your event in ReplicatedStorage and change your event variable to this:

local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent") 

Accept if this helped

0
Not working saying it not clicking, Werid, AlertShamrock 37 — 5y

Answer this question