When I try to make a nuke in my game it lets me buy the dev product and it does shake the camera but it doesn't actually clone the nuke. I am using a remote event to start both of these scripts but it either doesn't clone at all or either clones before I pay for the dev product. So the first script is the one that purchases the dev product:(Works)
local Id = 1147482990
local MPS = game:GetService("MarketplaceService")
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
MPS:PromptProductPurchase(Player, Id)
end)
This script processes the receipt and fires the remote events:(Works, it fires the one called Remote Event but it doesn't fire the one called GUI for some reason?) Its in ServerScriptService
local Mps = game:GetService("MarketplaceService")
Mps.ProcessReceipt = function(ReciptInfo)
if ReciptInfo.ProductId == 1147482990 then
local Player = game.Players:GetPlayerByUserId(ReciptInfo.PlayerId)
game.ReplicatedStorage.RemoteEvent:FireAllClients(Player)
game.ReplicatedStorage.GUI:FireAllClients(Player)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
This script is in StarterPlayerScripts and it makes the camera shake:(Works)
local Player = game.Players.LocalPlayer
local Remote = game.ReplicatedStorage:WaitForChild("RemoteEvent")
Remote.OnClientEvent:Connect(function()
local Hum = Player.Character.Humanoid
for i = 1,140 do
wait()
print("C")
Hum.CameraOffset = Vector3.new(
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1),
math.random(-1,1)
)
end
Hum.CameraOffset = Vector3.new(0,0,0)
end)
This is the script that also is in StarterPlayerScripts and it is supposed to clone the nuke when the purchase has been granted(Doesnt work and I bet there is something wrong with the script?)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
game.Lighting.Nuke:clone().Parent = game.Workspace
game.Workspace.Nuke:MoveTo(Vector3.new(570.494, 48.287, 5.565))
Anyone got ideas?

7 comments
BRUH im so dumb XD I need to relocate the place it clones as it clones in the wrong place for some reason. I this works ill accept it
Check out my new question as its a follow up and you could get another accepted answer for it
ummm it works but it spawns two of them in the same place, any way to kind of only let it spawn once before being spawning again
You can use debounce. https://developer.roblox.com/en-us/articles/Debounce
ummm it works but it spawns two of them in the same place, any way to kind of only let it spawn once before being spawning again
What would the script be then. Im not being lazy I just never understood debounce. I tried it before but it just wouldnt work at all. If you dont want to write it in Ill ask someone else as you helped me a lot anyway :)
I answered another question of yours