Ok first thing is i use my value num on click detect and pair (u can see in 8 line)
What i want is if my num are one i only can click on first button
here pic/code
wait(1)
local Md = require(game:GetService("ReplicatedStorage").Math)
local Main = script.Parent.Parent
local char = game:GetService("Players").LocalPlayer.Character
local hum = char:FindFirstChild("Humanoid")
local root = char:WaitForChild("HumanoidRootPart")
local num = 1
local cd = game:GetService("Workspace").Num.Button[num].cds
while true do
wait(1)
print(cd.Parent.Name)
print(cd)
end
function nigsdsga()
script.Parent.TextLabel.Text = Md[num]["Qu:Name"]
script.Parent.A.Text = Md[num]["A:Ch"]["A:Text"]
script.Parent.B.Text = Md[num]["B:Ch"]["B:Text"]
script.Parent.C.Text = Md[num]["C:Ch"]["C:Text"]
script.Parent.D.Text = Md[num]["D:Ch"]["D:Text"]
end
function explosion()
local ex = Instance.new("Explosion")
ex.Parent = workspace
ex.Position = root.Position
end
nigsdsga()
cd.MouseClick:Connect(function()
print("FORTHELOVEOFGOD")
if hum.Health > 0 then
print(cd.Parent.Name)
Main.Enabled = true
end
end)
script.Parent.A.Activated:Connect(function()
if Md[num]["A:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
script.Parent.B.Activated:Connect(function()
if Md[num]["B:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
script.Parent.C.Activated:Connect(function()
if Md[num]["C:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
script.Parent.D.Activated:Connect(function()
if Md[num]["D:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
i try print out a name and it work but not the click detector
Bro…i think my brain just dumb :edit nvm it still not work
wait(1)
local Md = require(game:GetService("ReplicatedStorage").Math)
local Main = script.Parent.Parent
local char = game:GetService("Players").LocalPlayer.Character
local hum = char:FindFirstChild("Humanoid")
local root = char:WaitForChild("HumanoidRootPart")
local num = 1
local cd = game:GetService("Workspace").Num.Button[num].cds
function nigsdsga()
script.Parent.TextLabel.Text = Md[num]["Qu:Name"]
script.Parent.A.Text = Md[num]["A:Ch"]["A:Text"]
script.Parent.B.Text = Md[num]["B:Ch"]["B:Text"]
script.Parent.C.Text = Md[num]["C:Ch"]["C:Text"]
script.Parent.D.Text = Md[num]["D:Ch"]["D:Text"]
end
function explosion()
local ex = Instance.new("Explosion")
ex.Parent = workspace
ex.Position = root.Position
end
nigsdsga()
cd.MouseClick:Connect(function()
print("FORTHELOVEOFGOD")
if hum.Health > 0 then
print(cd.Parent.Name)
Main.Enabled = true
end
end)
script.Parent.A.Activated:Connect(function()
if Md[num]["A:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
script.Parent.B.Activated:Connect(function()
if Md[num]["B:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
script.Parent.C.Activated:Connect(function()
if Md[num]["C:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
script.Parent.D.Activated:Connect(function()
if Md[num]["D:Ch"]["Isto/Fault"] == true then
num += 1
nigsdsga()
Main.Enabled = false
else
explosion()
end
end)
Okay, try also printing right on the top of the script to see if it runs at all. If it does print, place a breakpoint at the start of the script, and start debugging. This is so you can see if your script is halting anywhere.
That doesn’t show anything. I mean, use breakpoints to stop the script when it gets to it, then you can manually step Lua through the script to see where it goes and doesn’t go. If it doesn’t run the MouseEnter connection, then you can find out what is causing that.