Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to disable damage from tools?

Asked by 4 years ago

Im making PVP toggle GUI, but dont know how to actually disable the damage from sword for the players that disables PVP.

The damage from tool (for now im using "classic sword" but gonna change the tool later) must be taken only if player has PVP : ON

here's the script of GUI, im using FE, so on others screen peoples wont be died.

local colorf = script.Parent:WaitForChild("Color")
local button = script.Parent
local Toggle = false
local Event = game.ReplicatedStorage.Events:WaitForChild("PVPON")
local Event2 = game.ReplicatedStorage.Events:WaitForChild("PVPOFF")

function onClick()
if Toggle == false then
Toggle=true
colorf.ImageColor3 = Color3.fromRGB(76,177,96)
button.Text = "ON"
Event:FireServer()
else
Toggle=false
colorf.ImageColor3 = Color3.fromRGB(177,108,109)
button.Text = "OFF"
Event2:FireServer()
end
end

button.MouseButton1Down:connect(onClick)

there is nothing about disabling or enabling pvp, only GUI cause i dont actually know what to do.

0
When I read your question, many thoughts came through my mind, but none of them are easy. You could make a complex system which makes the swords detect if the target has PVP on or off. It would require alot of scripting and messing with events. I suggest you contact someone in a chat or something. Torren_Mr 334 — 4y

Answer this question