is it th waitforchild becasue i was just doing that to see if it was the issue and its not it should be
script.Parent.Parent.Equiped.Value = true
is it th waitforchild becasue i was just doing that to see if it was the issue and its not it should be
script.Parent.Parent.Equiped.Value = true
Remove the Waitforchild and print the Equipped value
The WaitForChild should not be an issue it wouldâve yielded and the code wouldnât work at all
I tried that and it is false for some reason
can you please try expaining in more simpler tearms im new to scripting
He means to add a print in the beginning of the function before all the if statements and check if its printing more than once after clicking just one time
kk, I did that and it prints, But something weird happened. it turns true now but it does not turn off??
script.Parent.MouseButton1Click:Connect(function()
print("ga")
if axetype.Value == true then
if script.Parent.Parent.Equiped.Value == false then
script.Parent.Parent.Equiped.Value = true
print(script.Parent.Parent.Equiped.Value)
script.Parent.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
script.Parent.UIStroke.Color = Color3.fromRGB(221, 0, 0)
script.Parent.Text = "UNEQUIP"
print("Baj")
unequipall()
ClearTools()
GiveTool()
else
if script.Parent.Parent.Equiped.Value == true then
script.Parent.Parent.Equiped.Value = false
script.Parent.BackgroundColor3 = Color3.fromRGB(0, 221, 255)
script.Parent.UIStroke.Color = Color3.fromRGB(0, 169, 221)
script.Parent.Text = "EQUIP"
ClearTools()
end
end
else
if script.Parent.Parent.Amount.Value <= player.leaderstats.Cash.Value then
game.ReplicatedStorage.Equip.Diamondaxe:FireServer()
ClearTools()
GiveTool()
script.Parent.Parent.Equiped.Value = true
else
return
end
end
end)
middle if satament
How many time did it print and also add a task.wait(0.1)
line right after that print
only once
also i just checked it is not turning true, but the script is printing true
You can remove the print replace these lines;
else
if script.Parent.Parent.Equiped.Value == true then
with
elseif script.Parent.Parent.Equiped.Value == true then
thanks, but it did not work, and when I pint the value it is true and but is not true when i check
This issue is rage-inducing I have to sleep Iâll be back tmrw
The 3 functions you run inside the if statement, especially the unequipall()
, could maybe be interfering with everything? Do they have wait
âs in them and do they change any values?
THANKYOU I relised that i tmakes the value so that it makes the value false it worked in otherscripts but thanks for the help a lot!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.