Solved How to use variables in give

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Senku

New Member
Jun 11, 2020
6
0
1
Skript Version (do not put latest): Skriptlang/Skript 2.5
Skript Author: ShaneBeere
Minecraft Version: 1.16.1
---
Full Code:

Code:
variables:
    {number} = 1
        
on mine of coal ore:
    player has permission "admin.admin":
        message "&fCoal ore broken successfully&c!"
    else:
        cancel event
        set {number} to a random integer between 1 and 10
        give coal {number} to the player
        message "&a+%{number}% &8Coal ore"


Errors on Reload:

Code:
'coal {number}' can't be added to a player because the former is neither an item type, an inventory nor an experience point (essentials.sk, line 535: give coal {number} to the player')

Console Errors:



Addons using (including versions):
skBee 1.4.2, Skellet (minehut fork)

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? No
What other methods have you tried to fix it? i tried putting %{number}% instead of {number}, but didnt work
 
the amount of items given has to be in front of the item.
Instead of give player coal {number}
use:
give player {number} coal
 
Status
Not open for further replies.