![]() |
Help :(
PHP Code:
|
first off, you should style your scripts. they look really sloppy. you don't even have a closing bracket for onPlayerChats()
the reason why the server flag isn't being set is because if this is a level NPC, which I'm assuming it is, triggerserver won't work. you'll need to use triggeraction. as far as triggerclient, I'm not sure if that works in a level NPC. |
PHP Code:
|
Change
PHP Code:
PHP Code:
|
Could be missing an "s".
|
Still nothing, i forgot i already made that change as well.
|
If it's a level npc and you're using triggeraction, then you catch the event on the serverside via onActionActionname(), not onActionServerSide().
In your case: PHP Code:
PHP Code:
|
This is what it is now.
PHP Code:
saying "playmidi midiname.mid" |
Quote:
|
PHP Code:
|
Quote:
PHP Code:
PHP Code:
As for your problem, I created a quick example of how to do it: PHP Code:
You can pass parameters by removing the part where I used empty quotations and replacing it with the parameters. |
I fixed the case problems, still nothing.
I missed the case problems, but I understand the triggers and what they do, but as you said as well, cant use triggerserver or client in a level npc. so, im left with PHP Code:
|
Quote:
When you use triggerAction() it doesn't work like triggerServer() where the first parameter is the action name. In the serverside your script is always going to call the return unless you said "playmidi midi" since params[0] in this case would equal whatever it is that you're sending in the triggerAction() command (i.e tokens[1] or t[1] in your case). Also, on the clientside part when you're doing this: PHP Code:
PHP Code:
PHP Code:
PHP Code:
triggerServer()). |
PHP Code:
still not working, if i followed you right, this is what im using now. |
HTML Code:
function onCreated() { |
everything works, except like you said the trigger by clientiside. tried a timeout, didnt work. maybe im still missing it somewhere.
and by the way its PHP Code:
|
Quote:
|
Actually, I'm self taught by trial, error, and viewing how other people code things. Can't say that something helps no one, when everyone is different in their learning patterns. Not saying do every script for everyone, just saying. Anyways off topic.
I forgot to add that it works when I enter the level, but not when I set it. Honestly, that's good enough for me. I'm tired of dealing with this script. If anyone want to explain how I could get it to play right after I set it, that would be cool, if not, I'm happy. |
Why are you using a serverr flag for this? You can just send the token setting the midi/streaming URL to the server. Also, it would be so much easier if you used a Gani for this.
In a weapon/level: PHP Code:
PHP Code:
|
That would have been easier, wish I would have thought of i, got it to go server flag though. I guess its the first thing that came to mind, then, just didn't think any further on the matter. xD
all well. Thanks for everyones help on the subject! |
Quote:
The problem with your previous script was that you were looping on the serverside through all players in the level and trying to call the triggerAction() that way back to clientside when you didn't need to do so. Simply call the triggerAction() without any loops (the same way you did on the clientside part), and then do the loop on the clientside to have the track play for all the players in the level. It would be smarter to use a seperate function for this because you would end up doing the loop on the onPlayerEnters() event which is not necessary. Instead of making the script call onPlayerEnters() after you trigger back to the clientside from the serverside, have it call a different function that will do the loop there. You're going to have to play around with the loop, though, since you would have to change around how you're doing it on the serverside to get the play command called on everyone in the level. Quote:
|
Quote:
|
Quote:
PHP Code:
|
Quote:
It should be: PHP Code:
|
Hiya sam- how're ya?
Since it's a level NPC I am assuming that he only wants it to effect the people in that level. |
Quote:
The original poster yes, but Switch not D: |
Quote:
|
| All times are GMT +2. The time now is 09:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.