ID:261455
 
Heres my code:

mob/verb/Say(msg as text)
if(findtext(msg,"fuck"))
msg = "****"
world <<"[usr]: [msg]"
else
world <<"[usr]: [msg]"


Ok,it works,exept,if you type text after the cuss it doesn't show up.So,say i wanted to say "fuck"

world <<"****"


That works.But say I wanted to say fuck u.

world <<"****"


It doesn't show u after the stars.Can somebody help?Thanks!

-Kappa the Imp


Kappa the Imp wrote:
Heres my code:
mob/verb/Say(msg as text)
> if(findtext(msg,"fuck"))
> msg = "****"
> world <<"[usr]: [msg]"
> else
> world <<"[usr]: [msg]"

...
It doesn't show u after the stars.Can somebody help?Thanks!

I addressed this in another thread recently. The reason it doesn't show u after the stars is that you're outright replacing the entire msg with "****". If you only want to replace part of it, you're going to have to splice parts together using copytext().

[EDIT]
[link] is the post I was referring to. Why you didn't read the entire thread before trying out one of the incomplete pieces of code presented in it is a bit of a mystery to me.

Lummox JR
In response to Lummox JR
Error:copytext(expected 2-4 agruments(found 1))
In response to Kappa the Imp
Kappa the Imp wrote:
Error:copytext(expected 2-4 agruments(found 1))

You know, you would do well to look at the reference some time. Here is the entry on copytext: http://www.byond.com/docs/ref/info.html#/proc/copytext