#Why does SurfaceGui not working?

1 messages · Page 1 of 1 (latest)

violet sentinel
#

Hello, So i made a ascend thing with SurfaceGui and noticed its not working nothing happens when i click the button not even prints working so i created a simple version with only part-SurfaceGui-TextButton and its still not working nothing happens when i click on it why?

#

my local script in the text button:

#

script.Parent.MouseButton1Click:Connect(function()
print("Clicked!")
end)

flat crater
#

use server script with runcontext set to local

violet sentinel
#

okay letme try that

violet sentinel
mellow horizonBOT
#

studio** You are now Level 6! **studio

violet sentinel
#

i stopped my project cuz of this

zealous fog
zealous fog
pastel vigil
flat crater
zealous fog
flat crater
zealous fog
#

put runcontext=server into backpack/playergui/etc and it runs twice

#

once from the container, and another from the deployed location

flat crater
#

So the containers that get cloned, result in it being ran twice

zealous fog
#

like starterpack, one copy runs in the starterpack container and the other in the actual player's backpack

#

so

#

convenient yeah sure, but generally bad practice coz of that

flat crater
#

i see

#

ty

zealous fog
#

before considering that having scripts that can execute from anywhere make organizing difficult, because you need to explicitly search out your scripts instead of simply knowing they can only be in certain containers

#

so, if you know about it and want to use it sure thats fine, but suggesting it to newbies is probably not a good idea because they barely know how to get a script to run, adding these extra problems on top that they aren't expecting is just going to cause more problems later

#

because there's always going to be someone who thinks, why dont i just make every script a runcontext=local or server script?

violet sentinel
zealous fog
#

or do idk i'm not your dad

violet sentinel
zealous fog
violet sentinel
#

why did u type that then

zealous fog
violet sentinel
#

So even that is not a good idea for surfacegui?

zealous fog
#

use collectionservice instead or something like that

#

it has other issues with streaming for example

violet sentinel
#

idk about collectionservice but ill look for some guides ty

zealous fog
#

if a part has a script in it when it streams it, the script also has to stream in

#

if you do this all over the place, that's a lot of scripts being downloaded repeatedly

violet sentinel
#

so bad for performance?

zealous fog
#

maybe roblox has some cache but probably dont want to rely on that

#

similar issue to cloning scripts in general

#

anyway

violet sentinel
#

yea i dont want my game to lag or taking forever to open

zealous fog
#

you can do whatever but if you do want to make all scripts out of runcontext=local then proceed in the full knowledge that it's a fairly stupid idea