Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my local script doesn't spawn admins in there place?

So i wrote this local script in StarterCharacterScripts:

player = game.Players.LocalPlayer if player.Name == "DashDQ" then player.Team = game.Teams.Admins end

Yeah also i made a spawn named Admins with Dark Stone Grey as color and a Teams Folder where i made a Team named Admins with the color Dark Stone Grey can anyone help me please?

2 answers

Changing the team on a localscript will only effect the localplayer, switch to a server script for it to work. You will also need to change localplayer to something else, maybe using onplayerentered, and move the script to a place where scripts can run (most notable workspace and serverscriptservice)

2 comments

0

still didn t work

1

Because your still using localplayer, you should use a onplayerjoin event and get the player via that. I

Its very simple to fix this, Instead of putting a local script in startercharacter (which is totally wrong) Put a server script in serverscriptservice Saying

local Admin = "DashDQ"
game.Players.PlayerAdded:connect(function(plr)
if plr.Name == Admin then
plr.Team = game.Teams.Admin
end
end)

1 comment

0

lowercase connect is depreciated, use :Connect()

This discussion is preserved as it was. New answers, comments, and votes are closed.