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

01local passid = 1124295568 -- The ID of the gamepass goes here
02local tools = {"Blunderbuss"} -- Blunderbuss
03local GamePassService = Game:GetService('GamePassService')
04game.Players.PlayerAdded:connect(function(player)
05repeat wait(0.1) until player.Backpack 
06repeat wait(0.1) until player.StarterGear
07if GamePassService:PlayerHasPass(player, passid) then
08for i = 1,#tools do
09game.ServerStorage.Tools.Gamepass:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
10game.ServerStorage.Tools.Gamepass:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear
11end
12end
13end)
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