Here's my script;
local part = script.Parent
local activated = false
part.Touched:connect(function()
print("dirt function started")
if activated == false then
activated = true
print("activated is now true")
local chance = math.random(1,100)
print("chance activated")
if chance > 1 and chance < 40 then
print("Found something")
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = 0
game.Players.LocalPlayer.PlayerGui.BattleGuiTest:WaitForChild("IntroTop"):TweenPosition(UDim2.new(0, 0,0, 0),'Out','Bounce',3.5)
game.Players.LocalPlayer.PlayerGui.BattleGuiTest:WaitForChild("IntroBottom"):TweenPosition(UDim2.new(0, 0,0, 200),'Out','Bounce',3.5)
wait(5)
game.Players.LocalPlayer.PlayerGui.BattleGuiTest:WaitForChild("BattleBackGround").Visible = true
wait(0.5)
--Might add functions
game.Players.LocalPlayer.PlayerGui.BattleGuiTest:WaitForChild("IntroTop"):TweenPosition(UDim2.new(0, 0,-1, 0),'In','Bounce',3.5)
game.Players.LocalPlayer.PlayerGui.BattleGuiTest:WaitForChild("IntroBottom"):TweenPosition(UDim2.new(0, 0,0, 800),'In','Bounce',3.5)
else
print("found nothing")
if activated == true then
return
end
end
end
end)
No errors but it won't find a number after several tries. Please help!
