|
| 13 Dec 2014 11:29 AM |
Hi, I am relatively new to scripting, I just started and am trying to build a game where there is a ball(which is a pickupable gear) and two teams try to grab the ball and get it to the opposite side, where it explodes. This is my legit first script ever:
local pad = script.Parent
local function steppedOn (part) local parent = part.Parent if parent:FindFirstChild ("WarRock") then print ("ive been touched") local explosion = Instance.new('Explosion', Workspace) explosion.Position = pad.Position end end
pad.Touched:connect (steppedOn)
And it works fine. However I am not any sort of expert on scripting tools, and I would like to make it so if a player kills the player with the ball, instead of despawning the ball, the ball just drops to the ground and can be picked up again. Can anyone point me in the right direction for tutorials or something on this? |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 11:49 AM |
| Would recopying the tool to the position of my death work? |
|
|
| Report Abuse |
|
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
|
| 13 Dec 2014 12:04 PM |
game.Players.PlayerAdded:connect(function(_) _.CharacterAdded:connect(function(__) __.Humanoid.Died:connect(function() for _,v in next,__:children''do if(v:IsA'Tool')then local newV=v v.Parent=workspace v.Handle.Position=__:waitForChild'Torso'.Position+Vector3.new(0,2,0) end end) end) end) |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 10:11 PM |
I've been adding on to the game, pretty much avoiding the drop all day.
I tried this code out, is there any special changes I need to make, and where should I put this script? I have a script that auto teleports the ball to a specific middle position if it is in the workspace, but once the player picks it up and dies it despawns. |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 10:14 PM |
| The way Garnished scripts is extremely annoying |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 10:23 PM |
| Yeah I agree garnish why do you use the most abstract things as variables? |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 10:43 PM |
| bleh this scripting stuff is hard there always seems to be another problem that I don't have the experience to fix. |
|
|
| Report Abuse |
|
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
| |
|