I’m trying to make it so if a player uses the proximity prompt it will check if it has 5 or more coins and then if the player does then it will give the item to the player.
local Players = game:GetService("Players").localplayer
local player = Players.LocalPlayer
local bloxxycola = game.Lighting.BloxyCola:Clone()
if script.Parent.Triggered then
if player:WaitForChild("leaderstats").Coins == 5 then
bloxxycola.Parent = game.StarterPack
end
end
if player:WaitForChild("leaderstats").Coins == 5 then
Here,you’re comparing an instance with a number, which is causing an error.
Thus- add .Value after the Coins.
bloxxycola.Parent = game.StarterPack
If you want to clone the bloxycola to the player -
You can either access to the player’s Backpack or StarterGear
[If you want to detect if a player is equipping a tool, you’ll check it on their character].