Alright so ive got this script here that basically does a bit of stuff, mainly do damage but the problem is that it only does damage in the client, how would i make it a serverside?
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
tool.Touched:Connect(function(OtherPart)
OtherPart.Parent:WaitForChild("Humanoid"):TakeDamage(10)
script.Enabled = false
wait(3)
script.Enabled = true
wait(3)
script.Enabled = false
if OtherPart.Parent:WaitForChild("Humanoid").Health == 0 then
player.leaderstats.Gold.Value = player.leaderstats.Gold.Value + 50
wait(0.4)
script.Parent.Parent.Main.Enabled = true
wait(1)
script.Parent.Parent.Main.Enabled = false
end
end)
local tool = script.Parent
local da = true
tool.Touched:Connect(function(OtherPart)
if OtherPart.Parent:FindFirstChild("Humanoid") and da == true then
da = false
local player = game.Players:GetPlayerFromCharacter(OtherPart.Parent)
OtherPart.Parent.Humanoid:TakeDamage(10)
wait(6)
da = true
if OtherPart.Parent:WaitForChild("Humanoid",5).Health == 0 then
player.leaderstats.Gold.Value = player.leaderstats.Gold.Value + 50
wait(0.4)
script.Parent.Parent.Main.Enabled = true
wait(1)
script.Parent.Parent.Main.Enabled = false
end
end
end)