#Run command in local script

1 messages · Page 1 of 1 (latest)

ionic thicket
#

Hi, I was wondering how would I make a clickable part that triggers a local script run an adonis command; the team and respawn commands. I tried using the _G API but it didn't work. I don't want to create a seperate plugin. Does anyone know how I would do this?

austere iron
#

why would you run it in a local script

ionic thicket
#

It's a team selector GUI and that's just how I decided to do it

austere iron
#

the team selector gui is made in adonis?

ionic thicket
#

No

austere iron
#

You do know if you make it change a player's team on a localscript other players won't see it right

#

@ionic thicket

ionic thicket
#

Oh bruh

#

You might of just resolved my issue

ionic thicket
#

Do you have any ideas

austere iron
#

Where was the localscript

#

and Where is the serverscript currently

ionic thicket
#

Same place as the script

austere iron
#

i'm pretty sure MouseButton1Click must be used in a localscript

ionic thicket
#

I'm getting the error Players.whoisjonahh.PlayerGui.TeamChoose.Jury.Script:5: attempt to index nil with 'Team'

#

@austere iron

austere iron
#

You're using game.Players.LocalPlayer in a localscript

ionic thicket
ionic thicket
austere iron
#

serverscript* my bad

#

you can only use that in a localscript

#

I won't walk you trough fully making this as I`m busy

#

please look up a tutorial on youtube or the roblox devforum

#

This isn't adonis related anyway so wrong place to ask

ionic thicket
#

Yup figured

#

Sorry for bothering

#

I'm assuming there isn't a simple script to this

austere iron
#

might be

ionic thicket
#

Simple fix*

#

sorry

austere iron
#

i also suggest learning a bit more about Luau coding (for example for loops)

#

All of these scripts could be turned into 1 for example

ionic thicket
#

I know how to do it this way

#

Lmk if you have an idea for the time being

#

I appreciate your help, cheers !

dense escarp
hollow stump
#

@ionic thicket Just a heads up

austere iron
#

they are not in the server

hollow stump
#

If its in StarterXYZ it's LocalScript

hollow stump
#

:(