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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 16 Jun 2014 07:54 PM |
Hm...
Did you try just dragging the TouchInterest into the button? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 16 Jun 2014 07:55 PM |
| Alright, one sec I'm gonna do some testing. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 16 Jun 2014 08:02 PM |
| Ugh this happened to me before. I just forget how I got the touchinterest in |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|