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

Stupidly simple size-tweening hover script, how come I can't get this working?

Asked by 8 years ago

The button should enlarge as your cursor hovers over it, but since I'm new to scripting, I don't know how to make this work.

function onButtonHover()
    script.Parent:TweenSize(UDim2.new(0,275,0,50))
end
script.Parent.MouseEnter:connect(onButtonHover)

function onButtonHover2()
    script.Parent:TweenSize(UDim2.new(0,250,0,50))
end
script.Parent.MouseLeave:connect(onButtonHover2)
0
http://hastebin.com/igoqivizif.lua I've explained this to you in the chat, so I won't bother adding an answer, I'll just post the solution. HungryJaffer 1246 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

Your problem lies here, it is supposed to be a local script in the TextButton, not a regular script. Reason being is normal scripts do things on the server like example:

game.Workspace.Part.BrickColor = BrickColor.Green()

That is something you would use a local script for. But anything in GUI's you have to use local scripts because it run's on the ROBLOX Client. A.K.A your computer. So when you use your script for a GUI it is trying to run on the ROBLOX Server but can't. So it gives no errors or runs at all.

Ad

Answer this question