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

Where do I put this script? [Unsolved]

Asked by 10 years ago

I don't know how to put the actual script code in correctly, but if you need to look at the script, I got it here:

https://scriptinghelpers.org/questions/2368/how-do-i-make-my-place-ranked-by-group

I tried the code in ServerScriptService, Teams, Players, and Workspace. Nothing works.

3 answers

Log in to vote
1
Answered by
Lacryma 548 Moderation Voter
10 years ago

It can either be in Workspace or ServerScriptService.

0
I tried both of those, and it did not work. :C Alyssall 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Have you tried Starterpack/StarterGUI?

0
Nope, i'll try that. I'll let you know if it works! Alyssall 0 — 10y
0
Ok. digitalzer3 123 — 10y
0
Nope, it didn't work. D: Alyssall 0 — 10y
Log in to vote
0
Answered by
Gamenew09 180
10 years ago

You put the script in Workspace because it is dealing with Leaderboards and we use the PlayerAdded event in game.Players. Oh and to add the code you press the Lua button while highlighting the code. (EDIT) The code that was provided didn't work because it didn't name the stats Value to leaderstats.

local GroupID = 1

game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats" -- Add this
local rank = Instance.new("StringValue", stats)
rank.Name = "Rank" -- Add this
rank.Value =player:GetRoleInGroup(GroupID)
stats.Parent = player
--[[player.CharacterAdded:connect(function(character)
local groupSpawns = game.Workspace:FindFirstChild("GroupSpawns"):GetChildren()
local torso = character:WaitForChild("Torso")
torso.CFrame = CFrame.new(groupSpawns[math.random(1,#groupSpawns)].Position)
end)]]
end)

0
I tried putting it in Workspace, it did not work. Am I doing the script wrongly? Alyssall 0 — 10y
0
First of all did you change the groupId? Gamenew09 180 — 10y
0
Where it says local GroupID- (I changed it to the ID of my group) So I believe so. Alyssall 0 — 10y
0
Add, stats.Name = "leaderstats" ,under where the "local stats" is. Gamenew09 180 — 10y
View all comments (3 more)
0
Also add rank.Name = "Rank" above rank.Value. Gamenew09 180 — 10y
0
Sorry, I don't understand what I have to do. What do I have to add to stats.Name = "leaderstats" and rank.Name = "Rank" ? Alyssall 0 — 10y
0
Just replace the code with whats above. Gamenew09 180 — 10y

Answer this question