Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help with my CAS script?

Asked by
yoshiegg6 176
10 years ago

This is in a local script in a tool. It uses context action service to call a function when you press R, it clones a part from server storage and plays an animation and it doesn't work at all. The output says something is wrong with line 19.

Edit:Fixed errors and it still won't work.

01--Normal variable setup
02local player = game.Players.LocalPlayer
03local char = player.Character
04local debounce = false
05 
06--Setting up the animation
07local animation = Instance.new("Animation")
08animation.Parent = script.Parent
09animation.AnimationId = "http://www.roblox.com/Asset?ID=21488069"
10local animTrack = char.Humanoid:LoadAnimation(animation)
11--Context Action Service
12local CAS = game:GetService("ContextActionService")
13 
14--Actual function I want to happen
15function firewall()
View all 34 lines...

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

LocalScripts don't have access to anything in ServerStorage (clients don't get copies of things there -- this means when players connect they don't have to load these things, which can speed up joining).

Use ReplicatedStorage for things that LocalScripts need to have access to.

0
Will replicatedstorage have any adverse effects like starting scripts in the model? yoshiegg6 176 — 10y
0
Nope. It's exactly the same as ServerStorage, it just copies to clients so that LocalScripts can use models inside of it. BlueTaslem 18071 — 10y
0
It still doesn't work and I put it in replicated storage. yoshiegg6 176 — 10y
0
And changed the script. yoshiegg6 176 — 10y
View all comments (4 more)
0
Is there an error? Have you done debugging? This definitely solve the only error you told us about. I can't help you if you can't help yourself BlueTaslem 18071 — 10y
0
I've been debugging for a while. Now there are no errors but no output either so I don't know what to fix. yoshiegg6 176 — 10y
0
If you have been debugging, you would have gotten output -- you should be figuring out what is happening. Debuggin is *NOT* staring at code and just thinking. It's actually performing experiments. BlueTaslem 18071 — 10y
0
So how should I debug this? What can I test to make this work? yoshiegg6 176 — 10y
Ad

Answer this question