dawg1480
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 53 |
|
|
| 26 May 2014 07:19 PM |
| On one of my places, I have VIP gamepasses, I have it were it gives you starter gear, but once you die, the gear disappears, anyway to fix this? |
|
|
| Report Abuse |
|
|
|
| 26 May 2014 07:21 PM |
| try CharacterAdded or workspace.ChildAdded and getPlayersFromCharacter |
|
|
| Report Abuse |
|
|
dawg1480
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 53 |
|
|
| 26 May 2014 07:27 PM |
| Did all of that, still didn't work. Any other ideas? |
|
|
| Report Abuse |
|
|
|
| 26 May 2014 08:00 PM |
| Maybe CharacterAdded so to see each time the player respawns if the player has the gamepass |
|
|
| Report Abuse |
|
|
|
| 26 May 2014 08:32 PM |
| you placed it in their backpack not their startergear |
|
|
| Report Abuse |
|
|
dawg1480
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 53 |
|
|
| 26 May 2014 08:52 PM |
This is the script, tell what exactly I should fix.. I have the items I want the VIP user to have in a IntValue box(es). I also have the game pass id in a IntValue.
local function WaitForChild(parent, childName) assert(parent, "ERROR: WaitForChild: parent is nil") while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end return parent[childName] end local GamePassService = Game:GetService('GamePassService') local PlayersService = Game:GetService('Players') local InsertService = Game:GetService('InsertService') local LightingService = Game:GetService('Lighting')
local GamePassIdObject = WaitForChild(script, 'GamePassId') local ToolAssetsToLoad = WaitForChild(script, 'ToolAssetsToLoad')
local AdminTools = LightingService:FindFirstChild('AdminTools')
local function CloneAdminTools(target) for _, tool in pairs(AdminTools:GetChildren()) do local toolClone = tool:Clone() toolClone.Parent = target end end
local function OnPlayerAdded(player) if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then local starterGear = WaitForChild(player, 'StarterGear') CloneAdminTools(starterGear) if player.Character then -- They've already loaded and won't get their StarterGear until next spawn local backpack = WaitForChild(player, 'Backpack') CloneAdminTools(backpack) end end end
if not AdminTools then AdminTools = Instance.new('Model') AdminTools.Name = 'AdminTools'
for _, intObject in pairs(ToolAssetsToLoad:GetChildren()) do if intObject and intObject:IsA('IntValue') and intObject.Value then local assetModel = InsertService:LoadAsset(intObject.Value) if assetModel then local asset = assetModel:GetChildren()[1] if asset then asset.Parent = AdminTools end end end end
AdminTools.Parent = LightingService end
PlayersService.PlayerAdded:connect(OnPlayerAdded)
|
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 26 May 2014 08:55 PM |
fixxed you need startergear and backpack
local function WaitForChild(parent, childName) assert(parent, "ERROR: WaitForChild: parent is nil") while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end return parent[childName] end local GamePassService = Game:GetService('GamePassService') local PlayersService = Game:GetService('Players') local InsertService = Game:GetService('InsertService') local LightingService = Game:GetService('Lighting')
local GamePassIdObject = WaitForChild(script, 'GamePassId') local ToolAssetsToLoad = WaitForChild(script, 'ToolAssetsToLoad')
local AdminTools = LightingService:FindFirstChild('AdminTools')
local function CloneAdminTools(target) for _, tool in pairs(AdminTools:GetChildren()) do local toolClone = tool:Clone() toolClone.Parent = target end end
local function OnPlayerAdded(player) if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then local starterGear = WaitForChild(player, 'StarterGear') CloneAdminTools(starterGear) if player.Character then -- They've already loaded and won't get their StarterGear until next spawn local backpack = WaitForChild(player, 'StarterGear') local stuff = WaitForChild(player, 'Backpack') CloneAdminTools(backpack) CloneAdminTools(stuff) end end end
if not AdminTools then AdminTools = Instance.new('Model') AdminTools.Name = 'AdminTools'
for _, intObject in pairs(ToolAssetsToLoad:GetChildren()) do if intObject and intObject:IsA('IntValue') and intObject.Value then local assetModel = InsertService:LoadAsset(intObject.Value) if assetModel then local asset = assetModel:GetChildren()[1] if asset then asset.Parent = AdminTools end end end end
AdminTools.Parent = LightingService end
PlayersService.PlayerAdded:connect(OnPlayerAdded)
ˢᶦᵈᵉ ᵉᶠᶠᵉᶜᵗˢ ᵐᵃʸ ᶦᶰᶜᶫᵘᵈᵉ﹕ ᶫᵃᶜᵗᵃᵗᶦᶰᵍ, ʰᵉᵃᵈ ᵉˣᵖᶫᵒᵈᶦᶰᵍ ˢʸᶰᵈʳᵒᵐᵉ, ᵃᶰᵈ ᶫᵒˢˢ ᵒᶠ ᵍᵉᶰiᵗᵃᶫˢ |
|
|
| Report Abuse |
|
|
| |
|
dawg1480
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 53 |
|
|
| 26 May 2014 09:01 PM |
| Thanks alot guys. You saved my life. Anyone know how to fix when a minigame ends, and the ambient goes to 255 255 255? |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 26 May 2014 09:01 PM |
those are you scripts, if you care to post them.
ˢᶦᵈᵉ ᵉᶠᶠᵉᶜᵗˢ ᵐᵃʸ ᶦᶰᶜᶫᵘᵈᵉ﹕ ᶫᵃᶜᵗᵃᵗᶦᶰᵍ, ʰᵉᵃᵈ ᵉˣᵖᶫᵒᵈᶦᶰᵍ ˢʸᶰᵈʳᵒᵐᵉ, ᵃᶰᵈ ᶫᵒˢˢ ᵒᶠ ᵍᵉᶰiᵗᵃᶫˢ |
|
|
| Report Abuse |
|
|
dawg1480
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 53 |
|
|
| 26 May 2014 10:21 PM |
| Sadly Robo, they didn't work. It didn't reload the gears after I died, is there a chance I would have to wait a certain amount of time before I obtain the gear back? |
|
|
| Report Abuse |
|
|
|
| 26 May 2014 10:26 PM |
Check this out http://www.roblox.com/Gamepass-Weapon-Giver-item?id=115687882 |
|
|
| Report Abuse |
|
|
dawg1480
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 53 |
|
| |
|