-
What do you want to achieve? I want to equip a specified tool when firing the event
-
What is the issue? it just doesn’t respond
-
What solutions have you tried so far? Rewriting the script and checking if everything is server-sided
the script is placed in ServerScript Service as a normal script and both of the print functions return output
server script service
local event = rep:WaitForChild("Equip")
event.OnServerEvent:Connect(function(plr, tool)
game.Workspace:FindFirstChild(plr.Name).Humanoid:UnequipTools()
wait(.01)
print("unequipped")
game.Workspace:FindFirstChild(plr.Name).Humanoid:EquipTool(tool)
print("equipped")
end)
local script to fire the event
local event = rep:WaitForChild("Equip")
script.Parent.MouseButton1Down:Connect(function()
game.Players.LocalPlayer.Character.Humanoid:EquipTool(game.Players.LocalPlayer:FindFirstChild(script.Parent.Text))
event:FireServer(game.Players.LocalPlayer, game.Players.LocalPlayer.Backpack:FindFirstChild(script.Parent.Text))
end)```
could anyone help me or does anyone have the same issue?
all answers/comments are appreciated thx!