Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Gamepass Script works in studio test but not on Game Server, problem with my script?

Asked by 7 years ago
Edited 7 years ago

Screenshot of the script: https://gyazo.com/e7c0bf2e93b3bf3208eb9f8a4dc32231

It works fine in studio, giving me the correct weapon dependant on what gamepass I have bought.

I looked in the Developer Console and only 3 scripts are running at that time: https://gyazo.com/19711e48a2d5d8e82277dcb1b8d89fcf

And then in the Server Log this was there: https://gyazo.com/1199b5face961e77d902ca2e46646e6b

[UPDATE] It loads in on this server: https://www.roblox.com/games/1106697638/H-EiTC-Stuff But not this one: https://www.roblox.com/games/1123799747/Eleuthera

local passid = 1124295568 -- The ID of the gamepass goes here
local tools = {"Blunderbuss"} -- Blunderbuss
local GamePassService = Game:GetService('GamePassService')
game.Players.PlayerAdded:connect(function(player)
repeat wait(0.1) until player.Backpack  
repeat wait(0.1) until player.StarterGear
if GamePassService:PlayerHasPass(player, passid) then
for i = 1,#tools do
game.ServerStorage.Tools.Gamepass:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
game.ServerStorage.Tools.Gamepass:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear
end
end
end)
1
Try using WaitForChild or FindFirstChild, that might help saSlol2436 716 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

If there is two different games and the same FM script, try to change the script abit. The tool, Blunderbuss might not be in game.ServerStorage.Tools or game.ServerStorage at all. So try to change Line 9 and 10.

Ad

Answer this question