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
 

Re: 500 robux to whoever

Previous Thread :: Next Thread 
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:30 PM
Fixes this script i want it to award a person who touches a brick get awarded 10 PP

And i also want it to teleport you back to the lobby because the obby is inside on a lobby

So how would i do that? I currently have a script but it wont teleport back to the lobby nor give PP

ready = true

local button = script.Parent
local amountontouch = 10
local PointsService = game:GetService("PointsService")
local availablepoints = PointsService:GetAwardablePoints()

local returnto = Workspace.Lobby.ReturnFromObby

button.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local character = player.Character
if player and ready and (availablepoints > 10) then
ready = false
PointsService:AwardPoints(player.userId, 10)
character.Torso.CFrame = CFrame.new(returnto.CFrame.X, returnto.CFrame.Y + 7, returnto.CFrame.Z)
wait()
ready = true
end
end)

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,038 / 90,000
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:33 PM
This is the only thing in my way from finishing my place

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,038 / 90,000
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:34 PM
eoeoe

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,038 / 90,000
Report Abuse
RaveZombie is not online. RaveZombie
Joined: 26 Apr 2013
Total Posts: 10
16 Jun 2014 07:36 PM
It looks fine. Do you have points that are available to be awardable in your place?
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:36 PM
Yep,

When i walk over it, It does nothing

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,038 / 90,000
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:38 PM
._.

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,036 / 90,000
Report Abuse
RaveZombie is not online. RaveZombie
Joined: 26 Apr 2013
Total Posts: 10
16 Jun 2014 07:40 PM
Do you get any errors?
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:41 PM
0

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,036 / 90,000
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:42 PM
wasd

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,036 / 90,000
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 07:43 PM
Make sure you insert a TouchInterest into the brick. It's supposed to automatically do that, but on several occasions my onTouch scripts don't work because it fails to add the TouchInterest.


If you can't insert the TouchInterest manually, just find a gear on free models, insert into your place and Copy & Paste the TouchInterest into the button.
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
16 Jun 2014 07:48 PM
I really don't know what the problem is, as I have never done anything with points, but to get the character, you don't need to use :GetPlayerFromCharacter(). The part touching it would most likely be one of the Players body parts, EG: The right arm;
So we could simply dub char as:
local character = hit.Parent
Instead of:
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local character = player.Character
And... Assuming the ReturnFromObby is a part... Just do this:
character:MoveTo(returnto.Position)

I have no idea with the points, however, as I stated before; Just a few pointers!
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:50 PM
@Pure

Found a free model with a touch interest but yet i cant put it anywhere

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,036 / 90,000
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 07:51 PM
@Alacrity; Click the TouchInterest, press Ctrl+X

Then click the button part, right click it and click "Insert into part" (or something along those lines)
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:54 PM
I click paste into and it does nothing

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,036 / 90,000
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 07:54 PM
Hm...

Did you try just dragging the TouchInterest into the button?
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:55 PM
Yep

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,036 / 90,000
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 07:55 PM
Alright, one sec I'm gonna do some testing.
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
16 Jun 2014 07:56 PM
Change the TouchInterest's parent from whatever model, to the part you want... Through command bar.

workspace.TouchInterest.Parent = workspace.Model.Part

I think you get it.
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 07:58 PM
@De, just tried that and inserted it into the touchinterest, It did nothing

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,037 / 90,000
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 08:00 PM
Go into Play Solo and touch the brick. Tell me if it creates a TouchInterest or not
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 08:01 PM
Nope

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,037 / 90,000
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
16 Jun 2014 08:02 PM
Aclarity... You know the command bar? I was giving an example of what you could put into it to change somethings parent, to something that wasn't really meant for that kind of child.

workspace.Model.Parent = game.Lighting.Message

See? You have to path it to the TouchInterest, then path it to the part you want it to after =.
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 08:02 PM
Ugh this happened to me before. I just forget how I got the touchinterest in
Report Abuse
AlacrityS is not online. AlacrityS
Joined: 16 Jun 2012
Total Posts: 23590
16 Jun 2014 08:04 PM
The part is inside of a model inside of a model

So theres a model and then inside that model there is another one and then theres the part

The part name is " Rewarder "

So i tried this and it didnt work

workspace.TouchInterest.Parent = workspace.Model.Rewarder

Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$16,037 / 90,000
Report Abuse
PurelyRandom is not online. PurelyRandom
Joined: 05 Mar 2011
Total Posts: 36763
16 Jun 2014 08:06 PM
Wait...

When you test it, do you have over 10 points? If not, the script isn't running because the Touched event you put only fires when the conditional statement is true, which requires your points to be higher than 10.
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