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

Ive made a script but it doesnt work in servers. only in studio. Can someone fix that for me?

Ive made a script that teleports people to a certain spawn when they are in the group . But the problem is, it doesnt work in servers. only in studio. Can someone fix that for me? I need this script to work in servers:

while wait(1) do 
if game.Players.LocalPlayer.TeamColor == BrickColor.new("Pastel green") or game.Players.LocalPlayer.TeamColor == BrickColor.new("Bright red")  then
	end
end

I hope someone can fix the script for me, Thanks!

5 comments

0

Is it a local script?

0

Yep

0

If It's A Local Script Then Check The Roblox Studio Wiki For What Local Scripts Are For And Where They Are Meant To Be.

0

Ok, by group do you mean http://wiki.roblox.com/index.php?title=Group or do you mean team: http://wiki.roblox.com/index.php?title=API:Class/Team . If you tell me, I should be able to help you. Message me on ROBLOX and hopefully I'll solve it.

0

ur the 20,000 user on scripting helpers just to let u know xdd chrisd_1908

2 answers

Ive added wait for child but it still doesnt work!

local player  =  game.Players.LocalPlayer:WaitForChild(script)

script.Parent.MouseButton1Click:connect(function(oof)
    player.TeamColor = BrickColor.new("Pastel Green")
    local humanoid = game.Players.LocalPlayer.Character.Humanoid
    humanoid.Health = 0
    local allow = (
        player:IsInGroup(3690337) or
        game.CreatorId == player.userId
    )
    if allow then
        oof ()       
    end 
--Made by SomeRandomGuy13564 for Chrisd_1908--

1 comment

0

Is there a server script too? If there is and Filtering enabled is on, look at RemoteEvents and Functions.

Hopefully, this should work:

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function(oof)
	player.TeamColor = BrickColor.new("Pastel Green")
	local humanoid = game.Players.LocalPlayer.Character.Humanoid
	humanoid.Health = 0
	local allow = (
		player:IsInGroup(3690337) or
		game.CreatorId == player.userId
	)
	if allow then
		oof()		
	end
end)

(PUT THIS IN A TextButton)

2 comments

0

It didnt work

0

Argh, did anything happen?

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