generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Player Points above head.

Previous Thread :: Next Thread 
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 04:46 PM
How would I go about making a gui above the players head that shows their player points?
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 04:47 PM
If you can help me with this I would be willing to pay.
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 05:09 PM
Bump
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
08 Jun 2014 05:11 PM
>BillboardGui
>game:GetService("PointsService"):GetPointBalance(player.userId)



★ Most viewed thread of all time, please support me by F5'ing it! http://www.roblox.com/Forum/ShowPost.aspx?PostID=136340077 ★
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 05:12 PM
Thank you buddy!
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
08 Jun 2014 05:13 PM
You're welcome.
Report Abuse
ThePunMan is not online. ThePunMan
Joined: 01 Jun 2014
Total Posts: 28
08 Jun 2014 05:20 PM
You will need to make a Billboard GUI over the player's head. The GUI will need to contain a textlabel.

Now, all you have to do is make a while true do loop that accesses the player points API and then uses that to retrieve the player's points:

(make sure this is a localscript)

while true do
wait() -- prevents loop from crashing
TEXTLABELADDRESSHERE.Text = game:GetService("PointsService"):GetPointBalance(game.Players.LocalPlayer.userId)
end

You will need to fill in the part that says "TEXTLABELADDRESSHERE", I'm not exactly sure where that is.

If there is an error in the script or you do not understand something, please do not hesitate to ask me. Hope this helped! :)
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 05:22 PM
What am I doing wrong?

game:GetService("PointsService"):GetPointBalance(player.userId)
function onPlayerRespawned(newPlayer)
wait(1)
local gui = Instance.new("BillboardGui")
gui.Parent=newPlayer.Character.Head
gui.Adornee=newPlayer.Character.Head
gui.Size=UDim2.new(2,0,.78,0)
gui.StudsOffset=Vector3.new(0,2,0)
local texta=Instance.new(PointsService:GetPointBalance(player.userId))
texta.Size=UDim2.new(1,0,1,0)
texta.BackgroundTransparency = .3
texta.BackgroundColor3 = Color3.new(0, 0, 0)
texta.BorderColor3 = Color3.new(0, 1, 0)
texta.TextColor3 = Color3.new(0, 1, 0)
texta.BorderSizePixel = 0
texta.TextScaled = false
texta.TextStrokeTransparency = 1
texta.FontSize = Enum.FontSize.Size9
texta.Parent=gui
end



function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
08 Jun 2014 05:24 PM
Use newPlayer.CharacterAdded(character) to determine when the player respawns.



★ Most viewed thread of all time, please support me by F5'ing it! http://www.roblox.com/Forum/ShowPost.aspx?PostID=136340077 ★
Report Abuse
ThePunMan is not online. ThePunMan
Joined: 01 Jun 2014
Total Posts: 28
08 Jun 2014 05:28 PM
game:GetService("PointsService"):GetPointBalance(player.userId)
function onPlayerRespawned(newPlayer)
wait(1)
local gui = Instance.new("BillboardGui")
gui.Parent=newPlayer.PlayerGui
gui.Adornee=newPlayer.Character.Head
gui.Size=UDim2.new(2,0,.78,0)
gui.StudsOffset=Vector3.new(0,2,0)
local texta=Instance.new("TextLabel")
texta.Size=UDim2.new(1,0,1,0)
texta.BackgroundTransparency = .3
texta.BackgroundColor3 = Color3.new(0, 0, 0)
texta.BorderColor3 = Color3.new(0, 1, 0)
texta.TextColor3 = Color3.new(0, 1, 0)
texta.BorderSizePixel = 0
texta.TextScaled = false
texta.TextStrokeTransparency = 1
texta.FontSize = Enum.FontSize.Size9
texta.Parent=gui
texta.Text = game:GetService("PointsService"):GetPointBalance(newPlayer.userId)
end



function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)



I think that should work.
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 05:36 PM
^ nope
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 05:40 PM
groupid = 72043

game.Players.PlayerAdded:connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
wait(1)
if newPlayer:IsInGroup(groupid) then
local gui = Instance.new("BillboardGui")
gui.Parent=newPlayer.Character.Head
gui.Adornee=newPlayer.Character.Head
gui.Size=UDim2.new(2,0,.78,0)
gui.StudsOffset=Vector3.new(0,2,0)
local texta=Instance.new("TextBox")
texta.Size=UDim2.new(1,0,1,0)
texta.BackgroundTransparency = .3
texta.BackgroundColor3 = Color3.new(0, 0, 0)
texta.BorderColor3 = Color3.new(0, 1, 0)
texta.TextColor3 = Color3.new(0, 1, 0)
texta.BorderSizePixel = 0
texta.TextScaled = false
texta.TextStrokeTransparency = 1
texta.FontSize = Enum.FontSize.Size9
texta.Text = ("- " .. newPlayer:GetRoleInGroup(groupid) .. " -")
texta.Parent=gui
wait(5)
if newPlayer:IsInGroup(409013) then
texta.TextColor3 = Color3.new(0, 0, 1)
texta.Text = ("- MP/" .. newPlayer:GetRoleInGroup(groupid) .. " -")
w = game.Lighting.WepsGroup:GetChildren()
for i = 1,#w do
w[i]:Clone().Parent = newPlayer.Backpack
end
end
end
end



function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)

Here is one that shows rank from a group. I need it to show player points.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
08 Jun 2014 05:40 PM
It isn't really even close to right. Here is one that will work.

local PointsService = game:GetService("PointsService")

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
local sb = Instance.new("BillboardGui")
sb.Parent = char:WaitForChild("Head")
sb.Name = "PP"
sb.AlwaysOnTop = true
sb.Size = UDim2.new(0, 100, 0, 25)
sb.StudsOffset = Vector3.new(0, 2, 0)

local tl = Instance.new("TextButton", sb)
tl.FontSize = Enum.FontSize.Size18
tl.Name = "PP"
tl.Text = "PP: " .. PointsService:GetPointBalance(player.userId)
tl.Size = UDim2.new(0, 100, 0, 10)
tl.TextColor3 = Color3.new(1, 0, 0)
tl.BackgroundTransparency = 1
tl.Font = Enum.Font.ArialBold

local img = Instance.new("ImageLabel", sb)
img.Image = "rbxassetid://155221172"
img.Size = UDim2.new(0, 20, 0, 20)
img.Position = UDim2.new(0, -15, 0, -5)
img.BackgroundTransparency = 1
img.BackgroundColor3 = Color3.new(1, 1, 1)

end)
end)

while wait(5) do
for i, v in pairs(game.Players:GetPlayers()) do
pcall(function()
v.Character.PP.PP.Text = "PP: " .. PointsService:GetPointBalance(v.userId)
end)
end
end


★ Most viewed thread of all time, please support me by F5'ing it! http://www.roblox.com/Forum/ShowPost.aspx?PostID=136340077 ★
Report Abuse
Vixxon is not online. Vixxon
Joined: 30 Apr 2013
Total Posts: 1255
08 Jun 2014 05:44 PM
@Forever you're awesome, thank you so much
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image