How the heck an I supposed to make this local script work?
01 | local player = game.Players.LocalPlayer |
05 | script.Parent.Touched:connect( function (toucher) |
06 | if game.Players:FindFirstChild(toucher.Parent.Name) then |
08 | local a = math.random( 1 , 25 ) |
09 | local b = math.random( 1 , 1 ) |
13 | print ( "A Wild Pokemon Appeared!" ) |
19 | player.PlayerScripts.CameraScript.Disabled = true |
20 | player.PlayerGui.BattleIntro.Frame 1 :TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 ), 'Out' , 'Bounce' , 1 ) |
22 | player.PlayerGui.BattleIntro.Frame 2 :TweenPosition(UDim 2. new( 0 , 0 , 0.1 , 0 ), 'Out' , 'Bounce' , 1 ) |
24 | player.PlayerGui.BattleIntro.Frame 3 :TweenPosition(UDim 2. new( 0 , 0 , 0.2 , 0 ), 'Out' , 'Bounce' , 1 ) |
26 | player.PlayerGui.BattleIntro.Frame 4 :TweenPosition(UDim 2. new( 0 , 0 , 0.3 , 0 ), 'Out' , 'Bounce' , 1 ) |
28 | player.PlayerGui.BattleIntro.Frame 5 :TweenPosition(UDim 2. new( 0 , 0 , 0.4 , 0 ), 'Out' , 'Bounce' , 1 ) |
30 | player.PlayerGui.BattleIntro.Frame 6 :TweenPosition(UDim 2. new( 0 , 0 , 0.5 , 0 ), 'Out' , 'Bounce' , 1 ) |
32 | player.PlayerGui.BattleIntro.Frame 7 :TweenPosition(UDim 2. new( 0 , 0 , 0.6 , 0 ), 'Out' , 'Bounce' , 1 ) |
34 | player.PlayerGui.BattleIntro.Frame 8 :TweenPosition(UDim 2. new( 0 , 0 , 0.7 , 0 ), 'Out' , 'Bounce' , 1 ) |
36 | player.PlayerGui.BattleIntro.Frame 9 :TweenPosition(UDim 2. new( 0 , 0 , 0.8 , 0 ), 'Out' , 'Bounce' , 1 ) |
38 | player.PlayerGui.BattleIntro.Frame 10 :TweenPosition(UDim 2. new( 0 , 0 , 0.9 , 0 ), 'Out' , 'Bounce' , 1 ) |
40 | player.PlayerGui.Pokemon.Togepi.Visible = true |
42 | player.PlayerGui.BattleIntro.Frame 1 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
43 | player.PlayerGui.BattleIntro.Frame 2 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
44 | player.PlayerGui.BattleIntro.Frame 3 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
45 | player.PlayerGui.BattleIntro.Frame 4 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
46 | player.PlayerGui.BattleIntro.Frame 5 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
47 | player.PlayerGui.BattleIntro.Frame 6 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
48 | player.PlayerGui.BattleIntro.Frame 7 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
49 | player.PlayerGui.BattleIntro.Frame 8 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
50 | player.PlayerGui.BattleIntro.Frame 9 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
51 | player.PlayerGui.BattleIntro.Frame 10 :TweenPosition(UDim 2. new( 0 , 0 , - 1 , 0 ), 'Out' , 'Bounce' , 1 ) |
52 | player.PlayerGui.Pokemon.Battle 1. ImageTransparency = 0 |
54 | player.PlayerGui.Pokemon.Frame:TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 ), 'Out' , 'Bounce' , 1 ) |
56 | player.PlayerGui.Pokemon.Battle 1 :TweenPosition(UDim 2. new( 0 , 0 , 0.212 , 0 ), 'Out' , 'Quad' , 1 ) |
57 | player.PlayerGui.Pokemon.Togepi:TweenPosition(UDim 2. new( 0.631 , 0 , 0.363 , 0 ), 'Out' , 'Quad' , 1 ) |
58 | player.PlayerGui.Pokemon.Fight:TweenPosition(UDim 2. new( 0 , 0 , 0.7 , 0 ), 'Out' , 'Back' , 1 ) |
60 | player.PlayerGui.Pokemon.Bag:TweenPosition(UDim 2. new( 0.25 , 0 , 0.7 , 0 ), 'Out' , 'Back' , 1 ) |
62 | player.PlayerGui.Pokemon.Switch:TweenPosition(UDim 2. new( 0.5 , 0 , 0.7 , 0 ), 'Out' , 'Back' , 1 ) |
64 | player.PlayerGui.Pokemon.Run:TweenPosition(UDim 2. new( 0.75 , 0 , 0.7 , 0 ), 'Out' , 'Back' , 1 ) |
I've been modifying this script non-stop for 4 hours. I just figured out that the hecking thing doesn't work in game. It says things like 'Attempt to index LocalPlayer' or sometimes it doesn't work at all. Help please. ;-;