#um im new to this server but ive been trying to find why this script isnt working

73 messages · Page 1 of 1 (latest)

wintry acorn
#

im sure it has to do something with the gui but im just going to wait for answers

thin relic
#

that is a localscript therefore anything that is in that script will only be visible on your client unless you use remote events

#

this

local ClickDetector = workspace.Lobby.AbilityPlatform.ButtonStand.ClickDetector
```is not right for a localscript
#

you should look into client-server communication, FindFirstChild, WaitForChild, etc

wintry acorn
#

oh

#

thanks

wintry acorn
thin relic
#

if you want it to do that then you can

#

or you can fire to the client who clicked to open gui

#

or you can have

local ClickDetector = workspace.Lobby.AbilityPlatform.ButtonStand.ClickDetector
```on the client but with "WaitForChild" because that could fail
wintry acorn
#

i see

thin relic
#

it usually happens that instances have not loaded while scripts are running

wintry acorn
#

yeah, it's because i found a video that explained the misuse of waitforchild so i tried to stop using it

#

too frequently that is

thin relic
#

waitforchild is when you are not sure if the instance has loaded

#

findfirstchild is when it exists and you want to find the first child with that name

#

sometimes the name of a part is like "Value", "Name", etc and you need to use findfirstchild because of property conflicts

wintry acorn
#

thanks for the clarification

thin relic
#

you're welcome

wintry acorn
#

so i can use remote server [function(player)] and change it to a server-side script

thin relic
#

you can also have it on the client if you will not need anything to happen on the server

#

anything that would have to happen in all other clients

#

if it only opens a gui it can be on the client

wintry acorn
#

in this context it's supposed to be an ability ui where you can scroll and select so yeah i guess client makes sense

#

you can make remote servers on client right?

thin relic
#

remoteevents can both be used by client and server. but for the communication to be possible the event must exist on both parties (client and server)

#

usually remote events are placed into replicated storage

#

replicated means it exists on the server and on the client and they share the same thing

wintry acorn
#

yeah i do that, ai misinforms me sometimes because it's kinda outdated

#

tbh i need to stop relying on ai most of the time

hexed stratus
#

Is it a Script or a LocalScript

#

@wintry acorn ?

wintry acorn
#

local script, but i fixed it. it was because a silly reason

#

this was supposed to be off

wintry acorn
rugged nebulaBOT
#

studio** You are now Level 3! **studio

hexed stratus
wintry acorn
#

it just worked perfectly after that

hexed stratus
wintry acorn
#

the script stayed in starterplayer

hexed stratus
hexed stratus
wintry acorn
#

what

timid harness
#

you also the put "MouseClick"

hexed stratus
#

@wintry acorn You should use Bindable

#

Method

wintry acorn
#

what is bindable

hexed stratus
#

Advanced Roblox Scripting Tutorial #8 - Remote Events & Remote Functions (Beginner to Pro 2019)

Hey guys! Welcome back to another roblox scripting tutorial and guys in today's tutorial I am going to be teaching you about remote events and remote functions. Now this is a pretty complex topic so if you are confused don't feel bad I was at first a...

▶ Play video
rugged nebulaBOT
#

studio** You are now Level 9! **studio

timid harness
#

use "MouseButton1Click" not just "MouseClick"!

wintry acorn
#

it only applies to textbuttons

timid harness
wintry acorn
#

yeah

wintry acorn
#

ill learn to use them

hexed stratus
timid harness
wintry acorn
#

hahaha

hexed stratus
wintry acorn
#

like that example

#

so it only replicates to client

#

it also talks about "InvokeServer()" which ive never heard of

hexed stratus
wintry acorn
#

o

#

ill search it up on documentary

#

the ability ui is supposed to be connected to a clickdetector that the local script detects and opens the gui if the local player clicks

#

so it should only apply on the client side

thin relic
#

The issue was that he was referencing the GUI in a script outside of GUI and, whenever he respawned, the previous GUI would get destroyed because of the "ResetOnSpawn" making the other script reference nil

hexed stratus
#

@wintry acorn More
Use :Connect() instead of :Once()