-- declarations and valuables
plr = game.Players.LocalPlayer
backpack = plr.Backpack
chr = plr.Character or plr.CharacterAdded:wait()
humanoid = chr:WaitForChild("Humanoid")
workspace.CurrentCamera.CameraSubject = humanoid
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
plrgui = plr.PlayerGui
screengui = plrgui.ScreenGui
frame = screengui.Frame
Bounce = frame.Bounce
Classic = frame.Classic
Spleef = frame.Spleef
darkerA = false
darkerB = false
darkerC = false
lobby = true
l1children = workspace.LOBBYONE:GetChildren()
l2children = workspace.LOBBYTWO:GetChildren()
l3children = workspace.LOBBYTHREE:GetChildren()
mouse = plr:GetMouse()
--gui
mouse.KeyDown:connect(function(key)
if key == 'q' then
frame:TweenPosition(UDim2.new(0,0,0,0) , "Out", "Quad", .2, true)
elseif key == 'e' then
frame:TweenPosition(UDim2.new(-.1,0,0,0) , "Out", "Quad", .2, true)
end
end)
--classic button
Classic.MouseEnter:connect(function()
darkerA = false
while Classic.TextColor3.g>.4 and darkerA == false do
game:GetService('RunService').RenderStepped:wait()
Classic.TextColor3 = Color3.new(Classic.TextColor3.r - .07, Classic.TextColor3.g - .05, Classic.TextColor3.b - 0)
end
end)
Classic.MouseLeave:connect(function()
darkerA = true
while Classic.TextColor3 ~= Color3.new(1,1,1)and darkerA == true do
game:GetService('RunService').RenderStepped:wait()
Classic.TextColor3 = Color3.new(Classic.TextColor3.r + .07, Classic.TextColor3.g + .05, Classic.TextColor3.b - 0)
end
end)
Classic.MouseButton1Click:connect(function()
swordremover()
for i,v in pairs(l1children) do
wait()
if v.Name == "Floor" then
local ran = math.random(1,2)
if ran == 1 and humanoid.Health == 100 then
chr:SetPrimaryPartCFrame(v.CFrame+Vector3.new(0,math.random(5,25),0))
camera()
break
end
end
end
end)
-- Bounce button
Bounce.MouseEnter:connect(function()
darkerB = false
while Bounce.TextColor3.b>.5 and darkerB == false do
game:GetService('RunService').RenderStepped:wait()
Bounce.TextColor3 = Color3.new(Bounce.TextColor3.r - 0, Bounce.TextColor3.g - .1, Bounce.TextColor3.b - .07)
end
end)
Bounce.MouseLeave:connect(function()
darkerB = true
while Bounce.TextColor3 ~= Color3.new(1,1,1)and darkerB == true do
game:GetService('RunService').RenderStepped:wait()
Bounce.TextColor3 = Color3.new(Bounce.TextColor3.r + 0, Bounce.TextColor3.g + .1, Bounce.TextColor3.b + .07)
end
end)
Bounce.MouseButton1Click:connect(function()
swordremover()
for i,v in pairs(l2children) do
wait()
if v.Name == "Floor" then
local ran = math.random(1,2)
if ran == 1 and humanoid.Health == 100 then
chr:SetPrimaryPartCFrame(v.CFrame+Vector3.new(0,math.random(5,25),0))
camera()
break
end
end
end
end)
-- Spleef button
Spleef.MouseEnter:connect(function()
darkerC = false
while Spleef.TextColor3.b>.6 and darkerC == false do
game:GetService('RunService').RenderStepped:wait()
Spleef.TextColor3 = Color3.new(Spleef.TextColor3.r - .1, Spleef.TextColor3.g - .1, Spleef.TextColor3.b - .05)
end
end)
Spleef.MouseLeave:connect(function()
darkerC = true
while Spleef.TextColor3 ~= Color3.new(1,1,1)and darkerC == true do
game:GetService('RunService').RenderStepped:wait()
Spleef.TextColor3 = Color3.new(Spleef.TextColor3.r +.1, Spleef.TextColor3.g + .1, Spleef.TextColor3.b + .05)
end
end)
Spleef.MouseButton1Click:connect(function()
swordremover()
for i,v in pairs(l3children) do
wait()
if v.Name == "Floor" then
local ran = math.random(1,2)
if ran == 1 and humanoid.Health == 100 then
chr:SetPrimaryPartCFrame(v.CFrame+Vector3.new(0,math.random(5,25),0))
camera()
break
end
end
end
end)
--sword remover
function swordremover()
local backpackchildren = backpack:GetChildren()
local chrchildren = chr:GetChildren()
for i,v in pairs(chrchildren) do
if v.Name == "ClassicSword" then
v:Destroy()
elseif v.Name == "BounceSword" then
v:Destroy()
end
end
for i,v in pairs(backpackchildren) do
if v.Name == "ClassicSword" then
v:Destroy()
elseif v.Name == "BounceSword" then
v:Destroy()
end
end
end
--camera
function camera()
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = CFrame.new(workspace.Sword.Position)*CFrame.Angles(math.rad(90),math.rad(180),0)*CFrame.new(0,0,5)
--died
function menu()
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = CFrame.new(workspace.Sword.Position)*CFrame.Angles(math.rad(90),math.rad(180),0)*CFrame.new(0,0,5)
end
humanoid.Died:connect(function()
wait(5)
menu()
end)
so this script is supposed to enable three buttons to change color when you mouse over them, and when you click on them they teleport you randomly. this is a local script located in starter player scripts. When I run it in studio I get an error : 20:49:38.574 - Can only tween objects in the workspace but when i play online the buttons work the first time, but after i die the tweening works but the buttons do not. they still change colors when you mouse over them but they don't teleport you when you click them. https://www.roblox.com/games/399972619/supercoolguy53s-Place-Number-122
