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

How come this works in Play Solo, but not in an active server?

Asked by 10 years ago

Alright, i've made this local script inside a Gui of mine, to make the buttons expand (have a little animation) once one's mouse enters the area of the button.

It works when i go to Test>PlaySolo, everything works fine. Not when i go to the game, from my profile, and play the game in an active server. Why?

Here is the LocalScript, for all 3 buttons:

Player = game.Players.LocalPlayer
Menu = script.Parent
Start = Menu.Start
Options = Menu.Options
Custom = Menu.CustomizePlayer

--Start
function MouseEnterStartButton()
    Start.Size = UDim2.new(0, 160, 0, 60)
    end

function MouseLeftStartButton()
    Start.Size = UDim2.new(0, 150, 0, 50)
    end


Start.MouseLeave:connect(MouseLeftStartButton)
Start.MouseEnter:connect(MouseEnterStartButton)

--CustomizePlayer
function MouseEnterCustomButton()
    Custom.Image = "http://www.roblox.com/asset/?id=146976841"
    end

function MouseLeftCustomButton()
    Custom.Image = "http://www.roblox.com/asset/?id=146974860"
    end


Custom.MouseLeave:connect(MouseLeftCustomButton)
Custom.MouseEnter:connect(MouseEnterCustomButton)


--Options
function MouseEnterOptionsButton()
    Options.Image = "http://www.roblox.com/asset/?id=146976841"
    end

function MouseLeftOptionsButton()
    Options.Image = "http://www.roblox.com/asset/?id=146974850"
    end



Options.MouseLeave:connect(MouseLeftOptionsButton)
Options.MouseEnter:connect(MouseEnterOptionsButton)

2 answers

Log in to vote
0
Answered by 10 years ago

Try placing the LocalScript inside the StarterGui. Also, where is the GUI located?

Ad
Log in to vote
0
Answered by 10 years ago

I recently had a similar problem with a tool. It turned out I just had to make the script a local script, but somebody said that adding a wait() at the start might work.

Answer this question