#Run command in local script
1 messages · Page 1 of 1 (latest)
why would you run it in a local script
It's a team selector GUI and that's just how I decided to do it
the team selector gui is made in adonis?
No
You do know if you make it change a player's team on a localscript other players won't see it right
@ionic thicket
I was using this script in a local script, and it's not working in a regular script
local player = game.Players.LocalPlayer
local team = game.Teams.Prosecutor
script.Parent.MouseButton1Click:Connect(function()
player.Team = team
end)
Do you have any ideas
Same place as the script
i'm pretty sure MouseButton1Click must be used in a localscript
I'm getting the error Players.whoisjonahh.PlayerGui.TeamChoose.Jury.Script:5: attempt to index nil with 'Team'
@austere iron
You're using game.Players.LocalPlayer in a localscript
What should I use instead
I'm using that in a server script
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
Yup figured
Sorry for bothering
I'm assuming there isn't a simple script to this
might be
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
Yeah I've heard that but
I know how to do it this way
Lmk if you have an idea for the time being
I appreciate your help, cheers !
You can create a remoteevent to transfer over the server/client boundry that runs the command using the _G API on the server.
I suggest sanity checks tho so exploiters cant change team when they arent meant to
@ionic thicket Just a heads up
they are not in the server
If its in StarterXYZ it's LocalScript