My concept is that the damage of the player's sword changes from the value 0 to 30 when you enter a brick. And I would also like to make it so when they leave the brick it changes the value back from 30 to 0 again. I am using the default roblox sword by the way, the LinkedSword. I am having trouble doing this, so I would appreciate some help.
This is what I have so far:
local Arena = game.Workspace.Arena Arena.Touched:connect(function(hit) end) Arena.TouchEnded:connect(function(leave) end)
What I would do is setup an int value that is inside the tool.
So first step would be creating a new IntValue inside the tool and naming it damage
Then going into LinkedSword Script
local damage = script.Parent:WaitForChild("damage").Value
Then your going to use in if statement to check if their is a humanoid and if there is then its going to make the IntValue damage value = 30
local Arena = game.Workspace.Arena Arena.Touched:connect(function(hit) if hit:FindFirstChild("Humanoid") then hit:WaitForChild("ToolName").damage.Value=30 end end) Arena.TouchEnded:connect(function(leave) if leave:FindFirstChild("Humanoid") then leave:WaitForChild("ToolName").damage.Value=0 end end)
That should work, dont have time to test if there is any errors and you cant figure it out speak with me on discord: Dawn#0666