Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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!

0
Is it a local script? Florian27 76 — 6y
0
Yep Chrisd_1908 0 — 6y
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. RoccoAttackYT 8 — 6y
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. CaptaiinNoob 52 — 6y
0
ur the 20,000 user on scripting helpers just to let u know xdd chrisd_1908 greatneil80 2647 — 5y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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--
0
Is there a server script too? If there is and Filtering enabled is on, look at RemoteEvents and Functions. MachoPiggies 526 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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)

0
It didnt work Chrisd_1908 0 — 6y
0
Argh, did anything happen? CaptaiinNoob 52 — 6y

Answer this question