I am cloning a roblox classic sword from replicated storage into a players backpack when they click a button in gui, i have got a remote event that runs the giving item code on the server.
When i attempt to equip the sword it makes the “shing” noise meaning that the event for equipping is working, but when i activate on the sword nothing happens.
I have tryed looking online on stack overflow, devforum but cant find the same issue.
Heres code from my gui button:
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.sendCloneAndPlayerToServer:FireServer(game.ReplicatedStorage.ShopGear.Sword)
end)
heres code from the server side event that handles the sword giving:
game.ReplicatedStorage.sendCloneAndPlayerToServer.OnServerEvent:Connect(function(player, item)
local clonedItem = item:Clone()
clonedItem.Parent = player.Character
clonedItem.Enabled = true
end)
I am using Sword by Roblox on toolbox for the tool.
1 Like
Im not sure, but I think that the Classical Sword has a function or event that when you equip the sword, the sword plays the soundtrack.
game.ReplicatedStorage.sendCloneAndPlayerToServer.OnServerEvent:Connect(function(player, item)
local clonedItem = item:Clone()
clonedItem.Parent = player.Backpack
clonedItem.Enabled = true
local char = player.Character
local hum = player.Humanoid
hum:EquipTool(clonedItem)
end)
1 Like
v1oxc
(cone)
August 4, 2024, 11:49pm
#3
I think you gave the player the sword locally…?
Or the Remote Event is used incorrectly.
1 Like
Can’t you just add the code to play the sound in the sword.Activated() function?
1 Like
ima inplement this and see if it works.
ok, i tryed this its not working, my problem is is that the eqiupping sound is playing when it gets equipped, but the activation doesnt work.
wait, there is a MouseIcon local script within the sword do you think that could be cauing the problem?
well Sword.Activated isnt even running, i put a print(“test”) in the Activated function before all the code and it is not printing.
I FIXED IT. Make sure that ManualActivationOnly inside your sword is turned off.
system
(system)
Closed
September 9, 2024, 11:23pm
#10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.