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 » Scripters
Home Search
 

Re: Help me fix

Previous Thread :: Next Thread 
Biss6 is not online. Biss6
Joined: 09 Jan 2015
Total Posts: 31
30 Jan 2016 09:23 PM
the leaderboard shows, but the goals dont go up.

game.Players.PlayerAdded:connect(function(player)

local stats = Instance.new("Model", player)
stats.Name = "leaderstats"

local points = Instance.new("IntValue", stats)
points.Name = "Goals"

end)

local v = Instance.new("StringValue")
v.Parent = game.Workspace.Model.Read.Bal
v.Name = "LastTouched"
v.Value = ""

function hit()
v.Value = hit.Parent.Name
end

game.Workspace.Model.Read.Bal.Touched:connect(hit)

game.Workspace.Model.Goal1.Touched:connect(function(goal1)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = v.Value.." Scored a goal to Red!"
local pl = game.Players:FindFirstChild(hit.Parent)
pl.leaderstats.Goals.Value = pl.leaderstats.Goals.Value +1
end)
game.Workspace.Model.Goal2.Touched:connect(function(goal2)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = v.Value.." Scored a goal to Blue!"
local pl = game.Players:FindFirstChild(hit.Parent)
pl.leaderstats.Goals.Value = pl.leaderstats.Goals.Value +1
end)
Report Abuse
XThane is not online. XThane
Joined: 08 Apr 2009
Total Posts: 2702
30 Jan 2016 09:29 PM
Any output?

~ Who's awesome, you're awesome ~ R$81,838 Tx1,170
Report Abuse
Biss6 is not online. Biss6
Joined: 09 Jan 2015
Total Posts: 31
30 Jan 2016 09:32 PM
The output is normal because the script isn't wrong, or messed up it just doesn't define the last person to touch the ball and the goal value to go up 1.
Report Abuse
Biss6 is not online. Biss6
Joined: 09 Jan 2015
Total Posts: 31
30 Jan 2016 09:52 PM
Do u know how to fix it?
Report Abuse
XThane is not online. XThane
Joined: 08 Apr 2009
Total Posts: 2702
30 Jan 2016 09:55 PM
A ball.touched function.



~ Who's awesome, you're awesome ~ R$81,838 Tx1,170
Report Abuse
Biss6 is not online. Biss6
Joined: 09 Jan 2015
Total Posts: 31
30 Jan 2016 10:12 PM
I have a ball touchd function but I don't know how to find who last touched the ball before thre goal..
Report Abuse
XThane is not online. XThane
Joined: 08 Apr 2009
Total Posts: 2702
30 Jan 2016 10:30 PM
Just set a variable, and when the player touches it, set them as the variable.

~ Who's awesome, you're awesome ~ R$81,838 Tx1,170
Report Abuse
Biss6 is not online. Biss6
Joined: 09 Jan 2015
Total Posts: 31
30 Jan 2016 10:39 PM
Can you give me an example pls or would this work :

a = Instance.new ("StringValue")
a.Parent = game.Workspace
a.Value = ""

game.Workspace.Model.Read.Bal.Touched:connect(hit)
a.Value = hit.Parent.Name
end)


game.Workspace.Model.Goal1.Touched:connect(function(goal1)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = a.Value.." Scored a goal to Red!"
a.Value.leaderstats.Goals.Value = a.Value.leaderstats.Goals.Value +1
end)


game.Workspace.Model.Goal2.Touched:connect(function(goal2)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = v.Value.." Scored a goal to Blue!"
a.Value.leaderstats.Goals.Value = a.Value.leaderstats.Goals.Value +1
end)
Report Abuse
Biss6 is not online. Biss6
Joined: 09 Jan 2015
Total Posts: 31
30 Jan 2016 10:40 PM
There is supposed to be (function (hit) for the bal.touched but I forgot to put it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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