Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GUI's work in play solo but doesn't work in game?

Asked by 8 years ago

I use a local script which controls all the GUIs. When I play in solo everything works perfectly, but when I play in game the GUIs don't work at all.

Anyone have any idea what's wrong?

0
can you post the script? User#5423 17 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

It's seems long, but it's actually just repetitive. It's for my animation testing.

local s = script.Parent
local player = game.Players.LocalPlayer

-- local mouse = player:GetMouse()

local anim1 = script:WaitForChild("Backflip")
local anim2 = script:WaitForChild("Frontflip")
local anim3 = script:WaitForChild("180_Backflip")
local anim4 = script:WaitForChild("Floppyfish")
local anim5 = script:WaitForChild("Runningbolt")
local anim6 = script:WaitForChild("LongBackflip")
local anim7 = script:WaitForChild("LongFrontflip")

local enabled = true

local backflip = s.Button
local frontflip = s.Button2
local backflip180 = s.Button3
local floppyfish = s.Button4
local runningbolt = s.Button5
local longbackflip = s.Button6
local longfrontflip = s.Button7

backflip.MouseButton1Down:connect(function()
if enabled then
   enabled = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim1)
animationTrack:Play()

wait(1)
enabled = true
end
end)

local enabled1  = true
frontflip.MouseButton1Down:connect(function()
if enabled1 then
   enabled1 = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim2)
animationTrack:Play()

wait(1)
enabled1 = true
end
end)

local enabled2  = true
backflip180.MouseButton1Down:connect(function()
if enabled2 then
   enabled2 = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim3)
animationTrack:Play()

wait(1)
enabled2 = true
end
end)

local enabled3  = true
floppyfish.MouseButton1Down:connect(function()
if enabled3 then
   enabled3 = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim4)
animationTrack:Play()

wait(1)
enabled3 = true
end
end)

local enabled4  = true
runningbolt.MouseButton1Down:connect(function()
if enabled4 then
   enabled4 = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim5)
animationTrack:Play()

wait(1)
enabled4 = true
end
end)

local enabled5  = true
longbackflip.MouseButton1Down:connect(function()
if enabled5 then
   enabled5 = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim6)
animationTrack:Play()

wait(1)
enabled5 = true
end
end)

local enabled6  = true
longfrontflip.MouseButton1Down:connect(function()
if enabled6 then
   enabled6 = false

local animationTrack = player.Character.Humanoid:LoadAnimation(anim7)
animationTrack:Play()

wait(1)
enabled6 = true
end
end)
Ad

Answer this question