I do not understand why it errors out when i do this i even tried player.Backpack instead of player.Character. Can someone help me
local ClassicSword = game.ReplicatedStorage.ClassicSword script.Parent.MouseButton1Click:Connect(function(player) local ClassicClone = ClassicSword:Clone() ClassicClone.Parent = player.Character end)
let me help u
put ur sword in ReplicatedStorage
create a RemoteEvent in ReplicatedStorage & name it "GiveSword"
create a script in ServerScriptService & add the code below
local swordEvent = game.ReplicatedStorage.GiveSword swordEvent.OnServerEvent:Connect(function(plr) local ClassicClone = game.ReplicatedStorage.ClassicSword:Clone() ClassicClone.Parent = plr.Backpack end)
now create a local script under ur sword giver button (where u had ur original code) & add the code below
local swordEvent = game.ReplicatedStorage.GiveSword script.Parent.MouseButton1Click:Connect(function() swordEvent:FireServer() end)
--Script local ClassicSword=game.ReplicatedStorage.ClassicSword local player=script:FindFirstAncestorOfClass"Player" script.Parent.MouseButton1Click:Connect(function() ClassicSword:Clone().Parent = player.Backpack end)