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 » Club Houses » ROBLOX Talk
Home Search
 

Re: Yet another scripting question

Previous Thread :: Next Thread 
ThunderStealth is not online. ThunderStealth
Joined: 09 Dec 2006
Total Posts: 67
16 Mar 2007 10:48 AM
Hi, I need a bit of help here. I'm trying to make a lap counter, which will count how many laps the player has done in my new Agility course. This is what I came up with so far:

function onTouched(part)
local stats = part.Parent:findFirstChild("leaderstats")
if stats ~= nil then
local laps = stats:findFirstChild("Laps")
laps.Value = laps.Value + 1

script.Parent.Touched:connect(onTouched)

I know something isn't right with it, because it won't work, lol. Can anyone fill me in on what I'm doing incorrect here?

Pilot
Report Abuse
ThunderStealth is not online. ThunderStealth
Joined: 09 Dec 2006
Total Posts: 67
16 Mar 2007 10:55 AM
Oh yeah, I had asked a question earlier about setting messages to be seen only by the player touching the brick. This is what I came up with so far as well:

tele = script.Parent.TeleportBrick

local debounce = false

message = nil
function showMessage(text)

hideMessage()
message = Instance.new("Message")
message.Text = text
message.Parent = game.Players.LocalPlayer
end

function hideMessage()
if message == nil then return end
message.Parent = nil
end

function TalkToPlayer(player)

debounce = true

showMessage("Welcome to the Arena!")
wait(3)
showMessage("Due to heavy construction")
wait(2)
showMessage("my Arena is closed until")
wait(2)
showMessage("construction is complete.")
wait(3)
showMessage("But go ahead and enjoy the lobby lol!")
wait(4)
showMessage("Best wishes from Pilot.")
wait(5)
message.Parent = nil

debounce = false
end


function onTouch(touchedPart)
print("touched")
local parent = touchedPart.Parent
if parent~=nil then
local humanoid = parent:findFirstChild("Humanoid", false);
if humanoid ~= nil and debounce == false then
TalkToPlayer(game.Players.LocalPlayer)
return
end
end
end

print(tele)

tele.Touched:connect(onTouch)

Now this script runs perfectly fine on solo, but not multiplayer. I'm trying to figure out how to make it run on multiplayer mode. Any help with this also is highly appreciated. Best!

Pilot
Report Abuse
SonOfSevenless is not online. SonOfSevenless
Top 100 Poster
Joined: 18 Feb 2007
Total Posts: 257
16 Mar 2007 04:29 PM
Are you just trying to make a brick that, when touched, will increment a lap counter? I'm not sure if that would be enough to enforce a race-track type system. People could just touch the brick a lot of times and score laps that way.

Anyways, I figured out how to add counters to my WWC map by studying the scripts in NukeTheWhale's place and in the Christmas map (I think the account is MerryChristmas, I don't remember). The Christmas map has a custom Presents counter that goes up whenever you touch a present brick. It's basically the same thing you want to do.

The short answer is, if you modify any existing leaderboard script to stick additional IntValues under the leaderstats object it creates, you will see additional columns on the leaderboard.

For your 2nd question, from looking at the BattleArmor script (in my place or in Glass Houses), I learned that you can show a message to a single player by sticking the Message object under the right Player object, rather than putting it in the Workspace.

Does any of that make sense? Maybe MrDoom will chime in here, he's been dealing with this stuff longer than I.
Report Abuse
k9chief is not online. k9chief
Top 100 Poster
Joined: 13 Oct 2006
Total Posts: 7238
16 Mar 2007 06:46 PM
UHHHHHHH...... Dont look at me lol
Report Abuse
BlueOreo36 is not online. BlueOreo36
Joined: 04 Mar 2010
Total Posts: 930
15 Dec 2010 03:36 PM
Woah thats a cool script
Report Abuse
MMORPGAILabs is not online. MMORPGAILabs
Joined: 27 Mar 2007
Total Posts: 1364
08 May 2017 05:50 AM
1252
Necro!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » ROBLOX Talk
   
 
   
  • 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