Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

so it works in studio but not on a server... my touch script wont run me reason?



if x == 1 then if key.KeyCode == Enum.KeyCode.Q then

print("test")

if test == false then return end test = false ani3load:Play()

local scr = script["Touch1"]:Clone()

scr.Parent = plr.Character scr.Disabled = false

wait(0.7) scr:Remove()

test = true end end

--it sets the touch scripts parent to the localplayer character but it wont run, it is a normal script and this script is a localscript. i do have repeat wait in this script to and the touch script should not need one. ~~~~~~~~~~~~~~~~~








2 comments

0

ops

0

Can you pls edit this question to fix the code block, you can also preview your question to see how it will be shown when it is posted.

1 answer

✓ Accepted answer

So, seems like there's an article to help you: here

But if it does not help you, here's my help!

So, the ROBLOX studio runs every single script locally, even server scripts.

The servers, of course, work differnent. Only localscripts are runned locally.

Since your script uses keybinding that should mean it is supposed to run locally.

The solution is to, just change the script into a localscript! Everything should run fine.

Remember, if your script uses something that acceses the player, detects the player's mouse, keyboard and others, USE A LOCAL SCRIPT!

A person who never made a mistake never tried anything new. Albert Einstein

Also, remember to use the code blocks correctly. Click the lua button and paste the code BETWEEN those 2 ~~~ bars.

1 comment

0

I also have the same issue with my haptic feedback scripts they work in studio but not anywhere else

This discussion is preserved as it was. New answers, comments, and votes are closed.