Hi, i want to make an axe and a tree. When i am touched a tree with axe, script will check is axe swinging.But when i add a bool value in a axe and change it with a script it didn’t work
What is the issue?
--change bool value
function Activated() --when you swing
if Tool.Enabled then
Tool.Enabled = false
script.Parent.IsSwing.Value = true
Whack = Humanoid:LoadAnimation(WhackAnim)
if Whack then
Whack:Play()
SlashSound:Play()
end
wait(ReloadTime)
script.Parent.IsSwing.Value = false
Tool.Enabled = true
end
end
---------------------------------------------------------
---check swing script
script.Parent.Touched:Connect(function(hit)
local tool = hit.Parent
if tool:FindFirstChild("IsAxe") then
if tool.IsSwing == true then
game.Workspace.sound1:Play()
print("test")
end
end
end)
script.Parent.Touched:Connect(function(hit)
local tool = hit.Parent
print(1)
if tool:FindFirstChild("IsAxe") then
print(2)
print(tool.IsSwing.Value)
if tool.IsSwing.Value == true then
game.Workspace.sound1:Play()
print("test")
end
end
end)
Ok, so you used client to make boolean val = true but server still sees it’s false because you didn’t set your boolean val with server script to make the server sees it’s true you need to move your boolean val = true into server script instead of localscripta ones to make server sees that your value is now true, not false.