local rs = game:GetService("ReplicatedStorage")
local End = rs.End
local paydeb = true
local jpcb = game:GetService("ReplicatedStorage").RemoteEventFolder.jpcb
local spcb = game:GetService("ReplicatedStorage").RemoteEventFolder.spcb
local mpcb = game:GetService("ReplicatedStorage").RemoteEventFolder.mpcb
jpcb.OnServerEvent:Connect(function(player)
if paydeb == true then
if player.leaderstats.Coins.Value >= 200 then
paydeb = false
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 200
end
end
end)
End.OnServerEvent:Connect(function(player)
if paydeb == false then
paydeb = true
end
end)
game.Players.PlayerAdded:Connect(function(player)
while true do
if paydeb == false then
local shop = player:WaitForChild("PlayerGui").Shop.Shadow
local sframe = shop.Frame.ScrollingFrame
local jump = sframe.GravityPot.CoinsButton
local speed = sframe.SpeedPot.CoinsButton
local mixed = sframe.MixedPot.CoinsButton
local toggle = player.PlayerGui:WaitForChild("EffectToggle").Shadow
jump.TextColor3 = Color3.new(0.784314, 0.784314, 0.784314)
jump.BackgroundColor3 = Color3.new(0.403922, 0.403922, 0.403922)
jump.Text = "Effect Active"
speed.TextColor3 = Color3.new(0.784314, 0.784314, 0.784314)
speed.BackgroundColor3 = Color3.new(0.403922, 0.403922, 0.403922)
speed.Text = "Effect Active"
mixed.TextColor3 = Color3.new(0.784314, 0.784314, 0.784314)
mixed.BackgroundColor3 = Color3.new(0.403922, 0.403922, 0.403922)
mixed.Text = "Effect Active"
toggle.Visible = true
elseif paydeb == true then
local shop = player:WaitForChild("PlayerGui"):WaitForChild("Shop").Shadow
local sframe = shop.Frame.ScrollingFrame
local toggle = player.PlayerGui:WaitForChild("EffectToggle").Shadow
local jump = sframe.GravityPot.CoinsButton
local speed = sframe.SpeedPot.CoinsButton
local mixed = sframe.MixedPot.CoinsButton
jump.TextColor3 = Color3.new(0.498039, 0.498039, 0.498039)
jump.BackgroundColor3 = Color3.new(1, 0.717647, 0)
jump.Text = "200 Coins"
speed.TextColor3 = Color3.new(0.498039, 0.498039, 0.498039)
speed.BackgroundColor3 = Color3.new(1, 0.717647, 0)
speed.Text = "300 Coins"
mixed.TextColor3 = Color3.new(0.498039, 0.498039, 0.498039)
mixed.BackgroundColor3 = Color3.new(1, 0.717647, 0)
mixed.Text = "350 Coins"
toggle.Visible = false
end
wait(.1)
end
end)
Above is server side script and below is the client script.
local jpcb = game:GetService("ReplicatedStorage").RemoteEventFolder.jpcb
local spcb = game:GetService("ReplicatedStorage").RemoteEventFolder.spcb
local mpcb = game:GetService("ReplicatedStorage").RemoteEventFolder.mpcb
jumppotcoinsbuy.MouseButton1Click:Connect(function()
jpcb:FireServer(player)
end)
I’m trying to make a potion effect shop. It takes away the coins just fine but the script is lengthy and I can’t figure out how to give the correct effect to the player.