|
| 17 Aug 2015 02:27 PM |
Make it so that if the person who spawns the car either dies or spawns a new one,
then it removes the car
local config = { gear = script.Parent, check = true, PlayersService = Game:GetService('Players'), DebrisService = Game:GetService('Debris'), MyCharacter = nil, MyTorso = nil, DeployedCar = nil, Tool = script.Parent, Handle = script.Parent:WaitForChild('Handle'), COOLDOWN_TIME = 5, Car = Game:GetService('InsertService'):LoadAsset(163379061):GetChildren()[1] };
function config.CreateOwnerTag() local ownerTag = Instance.new('ObjectValue') ownerTag.Value = config.PlayersService:GetPlayerFromCharacter(config.MyCharacter) ownerTag.Name = "Owner" return ownerTag end
function config.SpawnCar() if config.MyTorso then local ownerTag = config.CreateOwnerTag() if config.DeployedCar ~= nil then config.DeployedCar:Destroy(); end local carClone = config.Car:Clone(); ownerTag.Parent = carClone; carClone.Parent = workspace; carClone:TranslateBy((config.MyTorso.CFrame.p - config.Car:GetModelCFrame().p) + Vector3.new(0,5,0) + config.MyTorso.CFrame.lookVector * 15) carClone:MakeJoints() config.DeployedCar = carClone DebrisService:AddItem(config.DeployedCar, 60 * 15) end end
config.gear.Equipped:connect(function(m) -- config.Handle.Touched:connect(OnTouched); config.MyCharacter = config.gear.Parent; config.MyTorso = config.MyCharacter:WaitForChild('Torso'); m.Button1Up:connect(function() if config.check then config.check = false; config.SpawnCar(); wait(config.COOLDOWN_TIME); config.check = true; end end); end);
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:29 PM |
1
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:31 PM |
2
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:31 PM |
| if player=nil then clr.object |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Aug 2015 02:32 PM |
@Cali
gotta paste the whole script all put together and make it work!1
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:34 PM |
qq halp
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 210,153 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:35 PM |
3
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:35 PM |
| Add it after second section, I'm on mobile do I cant |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:37 PM |
@cali i added it after the second function and its not workin!
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:40 PM |
qqqqq
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:41 PM |
yyyyy
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:42 PM |
gggggg
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Aug 2015 02:43 PM |
qq
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,182 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:45 PM |
y u do dis
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,187 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:46 PM |
aaaaaaaaaaaaaaaa
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,187 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:47 PM |
kkkk
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,187 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:51 PM |
rwrw
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,127 ||~- |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 02:54 PM |
ergegege
-~|| CCC + LS IS NFT/NFS UNLESS OP || ROBUX: R$6,725 || RAP: 287,127 ||~- |
|
|
| Report Abuse |
|
|