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

Can someone change this from a Local script to a RemoteEvent?

Can someone please turn this into a RemoteEvent??

local requiredRankMinimum = 20 

local plr = game.Players.LocalPlayer

function Click(mouse) 
    if plr:GetRankInGroup(882106) >= requiredRankMinimum then 
        plr.TeamColor = BrickColor.new("Industrial white") 
    end 
end 

script.Parent.MouseButton1Click:connect(Click) 

Thanks!

1 comment

1 answer

✓ Accepted answer

Sure. Here you go! Pretty sure you can just make it into a script instead of a LocalScript and it will still work, but I'll do this anyways.

-- LocalScript

local requiredRankMinimum = 20 

local remoteevent = Instance.new('RemoteEvent', game:GetService('ReplicatedStorage'))
remoteevent.Name = "NewTeamColor"

local plr = game.Players.LocalPlayer

function Click(mouse) 
   remoteevent:FireClient(plr)
end 

script.Parent.MouseButton1Click:connect(Click)

-- Script

game.ReplicatedStorage:WaitForChild('NewTeamColor').OnClientEvent:connect(function()
	if plr:GetRankInGroup(882106) >= requiredRankMinimum then 
		plr.TeamColor = BrickColor.new("Industrial white") 
	end 
end)

I'm not in your group so I can't test this very easily, just let me know if it works.

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