|
So let me lay some things out first. This is a script, not local.
Here is what I made.
So I made a gamepass for a group(We'll use the ID as like 1234567)
When someone would buy that gamepass, In the GAME I made for the group, They would recieve something, Let's say they would recieve a lightsaber tool, that I made.
I wrote a script but the thing is, They will only recieve it after a server shutdown. Can anyone help me so that when someone is to buy the gamepass, REJOIN the game, they would have it?
|
|
|
|
iHydorrJoin Date: 2012-11-29 Post Count: 414 |
So basically, you want a shop that allows players to buy things from within the game and get the purchased item on the spot? |
|
|
Well I don't want an ingame shop, I just want so when someone minimizes the tab, Goes to the game STORE, Buys the gamepass, REJOINS the game, they will have that tool that they just bought. |
|
|
Right now the script I wrote does this.
*Minimizes the tab*
*Goes to the game store*
*Buys the gamepass*
*Has to wait until a new server to recieve it* |
|
iHydorrJoin Date: 2012-11-29 Post Count: 414 |
I do not think that is possible.
The only way you would be able to do that is through the in-game shop. |
|
iHydorrJoin Date: 2012-11-29 Post Count: 414 |
Wait wait wait. What does your script do? Isn't that in a way like an ingame shop? |
|
|
No it's just a script that's in the workspace that says if this player has the gamepass, give him this item. |
|
iHydorrJoin Date: 2012-11-29 Post Count: 414 |
As I said above. I do not think that it is possible to do that.
Can you post the script here? |
|
|
Are you using marketplaceservice?
|
|
|
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if game:GetService("GamePassService"):PlayerHasPass(player, ########## then game.Lighting:FindFirstChild("Darksaber"):Clone().Parent = player.Backpack game.Lighting:FindFirstChild("Darksaber"):Clone().Parent = player.StarterGear end end) This works but only gives the player the weapon in a new server. I want it like real games. Let's take Jailbreak for example. If you were to buy the car stereo, You just need to rejoin and you have it. How do I do this? |
|
iHydorrJoin Date: 2012-11-29 Post Count: 414 |
Okay so what you want is to not have to wait for a new server for the gamepass to function. |
|
|
|
local GpId = IDHERE
local Lightsaber = game.ServerStorage.Lightsaber -- Make sure to put the tool in the
-- "ServerStorage"
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
if game:GetService("GamePassService"):PlayerHasPass(plr, GpId) then
Lightsaber:Clone().Parent = plr.Backpack
else
end
end)
end) |
|
|
Error e.e
Workspace.Script:5: '=' expected near 'game' |
|
|
Nvm Figured it out.
Thanks, Hope this works. |
|