#How do I make a skript to give an effect when you have a certain item in your offhand
1 messages ยท Page 1 of 1 (latest)
wow how helpful read the docs ๐ค
- stop using the nerd emoji
- there's
item in player's offhandand by extensionif item in player's offhand is hey, you should put something different here. There also ison hand item swap:as an event. With this event there's the problem that it's called before the items are actually swapped so I recommend youwait 1 tickbefore running your actual code
i hope i helped
thank you finally a helpful thing instead of the "read the docs" thingy
oop same error as before
cant compare player with an item type
every 2 real seconds:
if item in player's offhand is nether quartz named "&eHaste Artifact":
wait 1 tick
apply speed 2 to player for 3 seconds
wait 1 second
remove speed from player```
and I have also tried looping all players
you can specify mc time or irl time. irl time is default though
no dont loop all players, especially in a periodical
either use on join and a while loop, or on hand item swap (althouhg idk if that triggers when you place it there through inventory)
what

hmm idk
some keywords maybe
like "offhand" and "potion effect"
x8ight lit mentioned it. Calling me a "nerd" will definitely higher the chances of me helping
Instead of saying
"search the docs" try actually helping
dou you want help from a nerd when you ask for help with something computer related?
im not saing spoon feed
really? it seems like you are
if you get your teachers to take all your exams for you you'll get pretty good grades.
But then when you get hired as an electrician you'll have no idea what to do
you need to work on things like this to gain experience and practice for the future
Im not gonna work on it professionally neither im gonna waste time learning it
And thats the reason we are saying look at docs... So you can learn from the docs
Skript
the basics
if you dont want to do it then dont do it
0% effort learning = you gain nothing
looking at docs and actually trying = you gain knowledge
problem solved
Yes
i never had the chance to work on "offhands"
goodbye, great day
well, good thing the docs can tell you how to use that
For help
skunity or skripthub are the best 2
this is for help fixing code that you already wrote
But if you want help you have to look at docs first so you're not wasting peoples time when you could've found the answer in docs
Cya
You have said cya like 20 times
Then if the answer is just "docs" there is no point in skript channels anyways ๐น
How to make a script for beginners:
- Try something.
- If it doesnt work:
- Do you get a error message when reloading?
- yes? Great. see what the errors say
- No? Most likely a logic error
- still having trouble? Make a thread and provide your code and any errors along with a description of what it is you are trying to accomplish
the error says cant compare player with an item
no
is means the same thing as "="
player (an entity; person) = an item?
no it doesnt
you want player's tool = ...
so just if player's offhand tool is smthing named "" or what
wow! see what happens when you try to do something without begging others?
good job. youre half way there
well there you go
well i didnt beg the others I asked just for the comparition line
because I couldnt find one
asking for a line is still asking for code
so half way there means i did the line right or...
you were literally given all you need too
that didnt work
well
im pretty sure
you went from 0% to 50%. do you think thats progress?
remember this?
send the error
lemme think how im gonna fix that hm
nononono
dont use a peridocial for this
and definitley dont loop all players
i didnt loop em
if player's offhand tool is nether quartz named "&eHaste Artifact":
wait 1 tick
apply speed 2 to player for 3 seconds
wait 1 second
remove speed from player```
it says an error
uhuh
yes
also
the docs would tell you you could add a potion replacing the existing effect
then you dont have to remove it
use
- on join and a while loop
- on hand item swap and a while loop
either one
dont forget a wait in the while loop
https://skripthub.net/docs/
do now
already did
i did on hand swap
send the code
on hand item swap
heres an official example
on swap hand items:
event-player's tool is a diamond sword
cancel event
thats why i said use a while loop
heres an example
while player is online: #will continue to run while the player is on
wait 1 hour
send "You've played for another hour! heres a reward" to player
give player 1 of diamond```
and how do I use this info to achieve the thing i want