I'm trying to make a script where a giant hand appears whenever a player says in gamechat "this game sucks" and it will fling them once it touches them but im not seeing anything wrong syntax wise more logic? any insight? https://gyazo.com/a70088c5a6b06923db4669a8480a2c87
#Fling a character based on text
1 messages · Page 1 of 1 (latest)
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
oh
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
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
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
are you doing this on the client? I can see you've indexed LocalPlayer
i put it under startercharacterscripts
thought it would bind to the character for when they talk
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
oooh
ok
would there be a difference if i put the script in starter character scripts or client?
serverscripts only should go in serverscriptserver
ofc they can go in workspace, but pls dont
localscript go on clients such as startetgui, startercharacter, etc
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
Do a bit more diagnosis of it. Add a print after the clone is added to the workspace and when the clone is touched.