I don't know why this isn't working. I made GroupID
and GroupRank
and TrainerTeam
in ServerScriptService>HostService
but I don't know what's wrong.
This is a Local Script.
local Player = game.Players.LocalPlayer local SSS = game:GetService("ServerScriptService") local HS = SSS:WaitForChild("HostService") local GroupID = HS:WaitForChild("GroupID").Value local GroupRank = HS:WaitForChild("GroupRank").Value local TrainerTeamColor = HS:WaitForChild("TrainerTeam").Value script.Parent.MouseButton1Down:connect(function() if Player:GetRankInGroup(GroupID) >= GroupRank then Player.TeamColor = TrainerTeamColor Player.Character:BreakJoints() end end)
^That's the output. Apparently it's not getting HostService. But I made sure I named the Folder right and I put the right name in the script. I don't get what's happening.
The main reason is because you're using a localscript with ServerScriptService
.
ServerScriptService DOES NOT replicate to clients.
As per the Wiki's definition of ServerScriptService
:
A semantic, organized place to put your server-sided game logic, which does not interfere with the world. Scripts will run inside this service, and will not replicate to game clients, allowing for secure storage of your scripts.
If you moved all your things to Replicated Storage and changed line 2 to
local SSS = game:GetService("ReplicatedStorage")
The above would work due to the fact that since you're using a localscript, the objects MUST be replicated to clients.
Source:
http://wiki.roblox.com/index.php?title=API:Class/ServerScriptService