Hello, so recently I’ve tried to follow a YouTube video about a nuke gamepass How to Make a NUKE GAMEPASS in ROBLOX! - YouTube. Everything worked in the uncopylock er game however when I transferred everything to my game it didn’t work. I’m not sure if it’s something i have to change with one of the scripts or what. Can someone help me figure out a solution thanks!
Uncopylocked game: Nuke - Roblox
ServerScript:
local mps = game:GetService("MarketplaceService")
local ts = game:GetService("TweenService")
local nukeFolder = game.ReplicatedStorage:WaitForChild("NukeFolder")
local remoteEvent = nukeFolder:WaitForChild("NukeRemoteEvent")
local isNuking = nukeFolder:WaitForChild("IsNuking")
local productId = nukeFolder:WaitForChild("DeveloperProductId").Value
function processReceipt(receipt)
if receipt.ProductId == productId then
if isNuking.Value == true then
return Enum.ProductPurchaseDecision.NotProcessedYet
else
isNuking.Value = true
local plrName = game.Players:GetNameFromUserIdAsync(receipt.PlayerId)
remoteEvent:FireAllClients("nuke message", plrName .. " has launched a nuke!")
local alarmSound = nukeFolder.AlarmSound:Clone()
alarmSound.Parent = workspace
alarmSound.Looped = true
alarmSound:Play()
wait(8)
local nuke = nukeFolder:WaitForChild("Nuke"):Clone()
local nukeSound = nukeFolder.NukeSound:Clone()
nukeSound.Parent = nuke
nukeSound.Looped = true
nukeSound:Play()
nuke.Position = workspace.Baseplate.Position + Vector3.new(0, nuke.Size.Y * 5, 0)
nuke.Anchored = true
nuke.Parent = workspace
local nukeTweenInfo = TweenInfo.new(8, Enum.EasingStyle.Linear)
local nukeTween = ts:Create(nuke, nukeTweenInfo, {Position = workspace.Baseplate.Position + Vector3.new(0, nuke.Size.Y/2 + 7, 0)})
nukeTween:Play()
nukeTween.Completed:Wait()
nuke:Destroy()
remoteEvent:FireAllClients("shake camera")
local explosionPart = nukeFolder.ExplosionPart:Clone()
explosionPart.Anchored = true
explosionPart.CanCollide = false
explosionPart.Size = Vector3.new(0, 0, 0)
explosionPart.Position = workspace.Baseplate.Position
explosionPart.Parent = workspace
local explosionSound = nukeFolder.ExplosionSound:Clone()
explosionSound.Parent = explosionPart
explosionSound:Play()
local oldRespawnTime = game.Players.RespawnTime
game.Players.RespawnTime = explosionSound.TimeLength
local explosionTweenInfo = TweenInfo.new(explosionSound.TimeLength, Enum.EasingStyle.Linear)
local explosionTween = ts:Create(explosionPart, explosionTweenInfo, {Size = Vector3.new(workspace.Baseplate.Size.X, workspace.Baseplate.Size.X, workspace.Baseplate.Size.X)})
explosionTween:Play()
for i, player in pairs(game.Players:GetPlayers()) do
local char = player.Character
if char then
local distance = (char.HumanoidRootPart.Position - explosionPart.Position).Magnitude
spawn(function()
repeat
wait(0.2)
until explosionPart.Size.X/2 >= distance - 30
remoteEvent:FireClient(player, "lighting effect")
wait(1)
char.Humanoid.Health = 0
end)
end
end
explosionSound.Ended:Wait()
game.Players.RespawnTime = oldRespawnTime
alarmSound:Destroy()
explosionPart:Destroy()
wait(5)
isNuking.Value = false
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
mps.ProcessReceipt = processReceipt
Local Script:
local ts = game:GetService("TweenService")
local mps = game:GetService("MarketplaceService")
local remoteEvent = game.ReplicatedStorage:WaitForChild("NukeFolder"):WaitForChild("NukeRemoteEvent")
local isNuking = game.ReplicatedStorage.NukeFolder:WaitForChild("IsNuking")
local productId = game.ReplicatedStorage.NukeFolder:WaitForChild("DeveloperProductId").Value
local nukeButton = script.Parent:WaitForChild("NukeButton")
local nukeLabel = script.Parent:WaitForChild("NukeMessageLabel")
nukeLabel.Text = ""
nukeLabel.Visible = false
function changeButtonState()
nukeButton.Visible = not isNuking.Value
end
changeButtonState()
isNuking:GetPropertyChangedSignal("Value"):Connect(changeButtonState)
function promptPurchase()
if isNuking.Value == false then
mps:PromptProductPurchase(game.Players.LocalPlayer, productId)
end
end
nukeButton.MouseButton1Click:Connect(promptPurchase)
remoteEvent.OnClientEvent:Connect(function(instruction, info)
if instruction == "nuke message" then
nukeLabel.Visible = true
for i = 1, string.len(info) do
nukeLabel.Text = string.sub(info, 1, i)
wait(0.05)
end
wait(5)
for i = string.len(info), 0, -1 do
nukeLabel.Text = string.sub(info, 1, i)
wait(0.05)
end
nukeLabel.Visible = false
elseif instruction == "shake camera" then
while game.Players.LocalPlayer.Character.Humanoid.Health > 0 do
local x = Random.new():NextNumber(-0.25, 0.25)
local y = Random.new():NextNumber(-0.25, 0.25)
local z = Random.new():NextNumber(-0.25, 0.25)
game.Players.LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(x, y, z)
workspace.CurrentCamera.CFrame *= CFrame.Angles(x/5, y/5, z/5)
wait()
end
elseif instruction == "lighting effect" then
local cc = Instance.new("ColorCorrectionEffect")
cc.Parent = game.Lighting
local ccTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)
local ccTween = ts:Create(cc, ccTweenInfo, {Brightness = 1, Contrast = 1, TintColor = Color3.fromRGB(255, 170, 0)})
ccTween:Play()
wait(game.Players.RespawnTime - 1)
cc:Destroy()
end
end)
Keep in mind there are no errors just simply won’t work in new servers.