#Fling a character based on text

1 messages · Page 1 of 1 (latest)

hard grove
runic gust
#

your if statement is wrong, you can't do if msg == "text" or "more text" or "more" then, you have to do if msg == "text" or msg == "more text" or msg == "more" then

hard grove
#

oh

runic gust
#

you can also do if string.lower(msg) == "this game sucks" then instead

#

the string.lower function just makes all the text lower case so you don't need to check all possible ways it could be typed

hard grove
#

ooo

#

im gonna see if this works now thank you

runic gust
#

no problem

#

also for your massive numbers of 9,000,000,000 you can use 9e9 instead, equals the same thing just means you don't have to type out as much, same with super small decimals but you use a minus sign instead like 9e-9 would be 0.0000000009

#

oh and another thing, you need to rename the variable in your .Touched connection, it's the same as your Vector3 variable so your force gets overwritten by the touching object, I'd rename it to 'other' or something like that

hard grove
#

these tips and tricks are amazing dude

#

i've put them all in but it's still not working do you think a heartbeat or loop would have the script constantly check for it the text is said in place of "playerAdded"?

#

im starting to think it will only attempt it once the character spawns but they wont talk at that time

runic gust
#

are you doing this on the client? I can see you've indexed LocalPlayer

hard grove
#

i put it under startercharacterscripts

#

thought it would bind to the character for when they talk

runic gust
#

you don't need the PlayerAdded connection then, you can just use LocalPlayer.Chatted

#

PlayerAdded is for every player that joins, not just the client, and PlayerAdded fires before any local scripts run so it doesn't fire for the local player

#

only players that join after them

hard grove
#

oooh

#

ok

#

would there be a difference if i put the script in starter character scripts or client?

pastel mesa
#

serverscripts only should go in serverscriptserver

#

ofc they can go in workspace, but pls dont

#

localscript go on clients such as startetgui, startercharacter, etc

hard grove
#

alr fellas so here's the updated version

#

still wont spawn the hand when i type. I've been reading up on some studio documents but im not sure what syntax is needed for it to pick up on in game text

nimble dagger
#

Do a bit more diagnosis of it. Add a print after the clone is added to the workspace and when the clone is touched.