My game is FE so I need to use remote events and I want to pass arguments through them but when I reference them in my server scripts, they return nil?
--Local Script (inside a tool in Workspace)
tool = script.Parent
local guiuse = script.Parent.PowerGui:Clone()
local RepStorage = game:GetService('ReplicatedStorage')
local ToolEvents = RepStorage:WaitForChild("ToolEvents")
local Heavy = ToolEvents:WaitForChild("Heavy")
local Light = ToolEvents:WaitForChild("Light")
function heavy()
Heavy:FireServer(script.Parent, guiuse)
end
function light()
Light:FireServer(guiuse)
end
tool.Equipped:connect(heavy)
tool.Unequipped:connect(light)
--Server Script (inside ServerScriptService)
Heavy.OnServerEvent:connect(function(player, parent, guiuse)
parent.Movement.Disabled = true
guiuse.Parent=game.Players:GetPlayerFromCharacter(parent.Parent).PlayerGui
parent.Movement.Disabled = false
end)
Light.OnServerEvent:connect(function(player, guiuse)
guiuse.Parent = nil
end)
