Sword not activating

I have a sword tool that is given to players globally when a remote event is activated. For some reason it is not able to activate once given to the players.

Here is the code:

local sword = game:GetService("ReplicatedStorage").Sword
local event = game:GetService("ReplicatedStorage"):WaitForChild("Winner")
local player = game:GetService("Players").LocalPlayer

event.OnClientEvent:Connect(function(s)
	local clone = sword:Clone()
	
	clone.Parent = player.Backpack
end)

If you have a solution, please respond!

2 Likes

For some extra information:

-Sword does clone to the player.

-Sword can no longer be activated.

1 Like

You are giving the sword on the client. Is that intentional? If you want other players to see it it will have to be done on the server.

Can you show your tool.Activated code?

1 Like

Im using the basic sword in the toolbox by roblox. The reason im giving the sword on the client so i communicate with the local player.

proximity.Triggered:Connect(function(player)
	event:FireAllClients()
end)
1 Like

Screenshot 2024-02-11 213806

1 Like

That code is server code. You gave the tool on the client so the server doesn’t know about it. You need to give the tool on the server so that it will replicate to all players.

so possibly would a way, be for a remote event to fire all clients which then individually fires the server to give to the player?

Hey i recently found a solution that was in the Roblox’s Battle Royale Template that showed how to give the sword to all players, thanks Roblox!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.